Skip to content

[app-cli] Support launcher-assigned session IDs (--session-id) for interactive amplifier and amplifier run #316

Description

@danshapiro

Context. We integrate Amplifier into a terminal-manager app (freshell, see danshapiro/freshell#514) that spawns amplifier in PTY panes and needs to know which session each spawned process owns (for resume, busy indicators, and session listing).

Problem. There is currently no way for the launcher to assign or discover the session ID at spawn (tested on amplifier 2026.07.06-7ec5dcd, core 1.6.0):

  • No --session-id/--id flag on amplifier or amplifier run (interactive or single-shot chat mode).
  • No AMPLIFIER_SESSION_ID env var is read or exported.
  • The session ID appears in the startup banner, but scraping styled TUI output is not a contract.
  • On-disk discovery is unreliable for correlation: the session directory is created lazily at the first prompt submit (not at process start), so directory creation order can invert process spawn order when multiple sessions launch in the same project.

We currently work around this by correlating the pane's Enter keypress with new session-directory creation plus the session:config cwd — it works, but has an irreducible ambiguity window when two sessions in the same cwd submit their first prompts near-simultaneously.

Ask. Accept a caller-supplied session ID (flag and/or env var) for interactive and run modes, mirroring what amplifier-server create --session-id already supports. The plumbing appears to exist (SessionConfig.session_id; create_session_from_bundle(session_id=...)). Alternatively (or additionally), export the generated session ID to child processes / a pointer file at startup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions