Skip to content

Extract load lifecycle orchestration #61

Description

@gadflysu

Goal

Extract load lifecycle orchestration from main.go into a shared boundary so list mode, interactive mode, and the future debug-load performance hook can reuse source loading behavior without copying logic.

Current problem

main.go currently owns two load paths:

  • list mode waits for a complete session list before rendering rows;
  • interactive mode starts the picker immediately and feeds it streaming batches.

The source loaders are partly reused, but orchestration concerns are split across main.go: source selection, source concurrency, date filtering, partial failure handling, complete-load result construction, stream completion, and batch ownership.

Desired direction

  • Add a dedicated load lifecycle boundary.
  • Keep complete loading and streaming loading as separate caller-facing paths.
  • Move the streaming batch contract to the load boundary so picker consumes the loader-owned batch type directly.
  • Preserve current behavior for list mode and interactive mode.
  • Do not add new CLI flags in this issue.

Non-goals

  • Do not implement --debug-load; that belongs to Add debug-load performance hook #59.
  • Do not change source parsing behavior.
  • Do not change list output formatting.
  • Do not change interactive key handling or picker rendering.
  • Do not add benchmark tooling.

Plan

See docs/agent/plan-issue-61-load-lifecycle-refactor.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformancePerformance improvement or optimization

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions