Skip to content

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

Description

@danshapiro

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).

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