test: lock the proactive backend-id guarantee (never-again) - #104
Conversation
…gress The durable fix for "an agent loses its backend id and becomes unresumable" is that aimux assigns the id at spawn: it launches claude with its own --session-id and persists it immediately (saveState -> topology), rather than discovering it later. That already works, but like the reactive hook path that 298d5a1 silently broke, nothing locked it. Lock the two points it could regress: - config: the default claude tool ships sessionIdFlag ["--session-id", "{sessionId}"] with backend-resume enabled. Dropping it recreates the failure mode. - session-launch: a fresh claude launch (given that flag, as the spawn path passes it) generates a uuid backend id, passes it as --session-id, and persists via saveState. Together with the W0 reactive-capture test, both capture paths are now guarded. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adds test coverage for backend session ID handling across two test suites. The first test verifies that the default Claude configuration properly initializes a session ID flag and resume arguments. The second test confirms that session creation generates a unique ID, binds it into the command, and persists the state. ChangesBackend Session ID Test Coverage
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Goal: never again
The durable answer to "an agent loses its backend id and can't be restored" is proactive assignment: aimux launches claude with its own
--session-id(config.ts:148) and persists it the instant the session spawns (session-launch.ts:530→:545 saveState→ topology, fsync-durable via W1). The id is never discovered after the fact — it's known from the start.That already works (empirically, almost every project shows
1/1claude sessions with a backend id). The stranded tealstreet-next sessions were legacy, spawned before the--session-idflag existed.The gap was not behavior — it was the lack of a lock. The reactive hook path silently rotted in
298d5a1precisely because no test guarded it. This PR guards the proactive path the same way, at the two points it could regress:sessionIdFlag: ["--session-id", "{sessionId}"]with backend-resume enabled. Drop it and the failure mode returns.--session-id <uuid>, and persists viasaveState.Together with the W0 reactive-capture test, both capture paths are now test-locked. If either regresses, CI fails instead of an agent silently becoming unrecoverable after the next crash.
Verification
Tests-only — no runtime change.
yarn verifygreen: typecheck + lint clean, 1029/1029 tests.🤖 Generated with Claude Code
Summary by CodeRabbit