microsoft / microsoft/amplifier

[app-cli] Write session identity to disk at session start, not at first prompt:complete

Open
#317 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

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.jsonl appear (the latter only when the hooks-logging module is mounted).
  • First prompt:complete: metadata.json and transcript.jsonl finally appear.

Problems.

  1. An interactive session opened and closed without a prompt leaves no trace, despite having announced a session ID.
  2. A session killed (e.g. SIGKILL) after first submit but before first prompt:complete leaves an orphan dir containing only events.jsonl — no metadata.json ever — which is invisible to session list and unresumable.
  3. External tools cannot enumerate or identify live sessions until the first turn finishes; metadata.json (with its useful working_dir field) 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

  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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.