microsoft / microsoft/amplifier

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

Open
#316 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.1k
Forks
261
Avg merge
3h 28m
Merged PRs (30d)
13

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the CLI entry points for interactive amplifier and amplifier run, then compare their session creation path with amplifier-server create --session-id. Trace SessionConfig.session_id and create_session_from_bundle(session_id=...); done means a caller-supplied ID is accepted consistently in both modes and the resulting session uses it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.