Skip to content

fix(engine): fresh engines resume existing sessions (restart-survival gate fix) - #96

Merged
Pher217 merged 1 commit into
mainfrom
claude/2026-07-02-engine-resume-hint
Jul 2, 2026
Merged

fix(engine): fresh engines resume existing sessions (restart-survival gate fix)#96
Pher217 merged 1 commit into
mainfrom
claude/2026-07-02-engine-resume-hint

Conversation

@Pher217

@Pher217 Pher217 commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Goal

The PR #95 live gate failed its restart-survival step: after a daemon restart, a fresh engine spawned --session-id for an already-existing session → claude exits ('Session ID already in use') → turn failed. Engine-mode reincarnation of gotcha #24.

Change

Thread the existing started hint from the headless.prompt frame through _interactive_turn into InteractiveEngine(started=...) — first spawn uses --resume when the session pre-exists. One new test (started=True → first spawn has --resume, not --session-id).

Test Summary

host-agent 260 passed (2 pre-existing drain failures, identical on main). Ruff clean.

After merge

I re-run the full live gate: 2 turns → daemon restart → turn 3 must recall the codeword.

…essions

The live gate caught it: after a daemon restart, a fresh InteractiveEngine
spawned with --session-id for a session that already existed on disk;
claude exits with 'Session ID already in use' and the turn fails (the
engine-mode reincarnation of gotcha #24). The headless.prompt frame already
carries the started hint — thread it through _interactive_turn into the
engine so the first spawn uses --resume when the session pre-exists.

host-agent: 260 passed (2 pre-existing drain failures).
@Pher217 Pher217 self-assigned this Jul 2, 2026
@Pher217
Pher217 merged commit b69e170 into main Jul 2, 2026
1 check passed
@Pher217
Pher217 deleted the claude/2026-07-02-engine-resume-hint branch July 2, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant