microsoft / microsoft/amplifier
[app-cli] Write session identity to disk at session start, not at first prompt:complete
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 261
- Avg merge
- 3h 28m
- Merged PRs (30d)
- 13
Description
Observed on amplifier 2026.07.06-7ec5dcd, timeline of a fresh interactive session (sub-second polling):
- Process start: banner prints the session ID; nothing exists on disk for it.
- First prompt submit (+~37ms): session dir +
events.jsonlappear (the latter only when the hooks-logging module is mounted). - First
prompt:complete:metadata.jsonandtranscript.jsonlfinally appear.
Problems.
- An interactive session opened and closed without a prompt leaves no trace, despite having announced a session ID.
- A session killed (e.g. SIGKILL) after first submit but before first
prompt:completeleaves an orphan dir containing onlyevents.jsonl— nometadata.jsonever — which is invisible tosession listand unresumable. - External tools cannot enumerate or identify live sessions until the first turn finishes;
metadata.json(with its usefulworking_dirfield) arrives seconds-to-minutes after the session actually began.
Ask. Write a minimal identity stub at session creation — even just {session_id, created, working_dir} in metadata.json (updated later with name/description/turn_count as today) — so a session's identity exists on disk for its entire lifetime. This would also eliminate the orphan-dir class in (2).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the app-cli session-creation path and trace when metadata.json is first written, then inspect how session list and resume discover session directories. Add the initial identity metadata at creation while preserving later updates for name, description, and turn count. Verify that an interactive session creates metadata immediately and that session list can see it before the first prompt completes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100