feat: one recovery path — aimux repair reconciles stranded backend ids - #101
Conversation
`aimux repair` already rebuilds the tmux runtime; extend it to also backfill missing backend session ids for offline agents from each tool's on-disk session store. This gives a single, obvious "fix my stranded agents" command that operationalizes the capture (W0) and reconcile (W2) work — run it once to recover agents whose backend id was lost to a crash before this change existed, rather than waiting for a per-agent resume. - reconcileOfflineBackendSessionIds: idempotent topology backfill over offline sessions; only touches sessions missing an id with a discoverable on-disk transcript. - repair command prints (and json-emits) the recovered ids. Deliberately no command renames: the documented agent verbs (spawn, stop, kill, fork, worktree) stay put to avoid churn. A broader noun-grouped CLI hierarchy is proposed separately for sign-off rather than forced here. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 (3)
📝 WalkthroughWalkthroughThis PR adds offline backend session ID reconciliation. A new ChangesOffline Backend Session ID Reconciliation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Context (epic W3)
The investigation that started this work surfaced a sprawling, hierarchy-less command surface (~80 commands, ~23 flat at top level, four overlapping "fix my runtime" paths). The instinct was a noun-grouped restructure — but the documented agent verbs (
spawn,stop,kill,fork,worktree …) are public and a mass rename is pure churn for users and scripts. So this epic delivers direction without churn: one obvious recovery command, no renames.Change
aimux repairalready rebuilds the tmux runtime. It now also runs a backend-id reconcile sweep: for every offline agent missing a durable backend session id, it discovers the id from the tool's on-disk session store (W2'sdiscoverBackendSessionId) and backfills it into the topology.reconcileOfflineBackendSessionIds(projectRoot)— idempotent; only touches offline sessions that are missing an id and have a discoverable transcript; preserves offline status and all other fields (no binding, no status flip).repairprints (and--jsonemits) the recovered ids.This operationalizes W0 (capture) + W2 (per-resume reconcile) into a single proactive action: run
aimux repaironce to recover agents whose backend id was lost to a crash before these fixes existed — including theclaude-omdtnpsession that started all this.Why no renames
A separate, user-gated proposal will cover the broader noun-grouped hierarchy (
agent …,project …, retiring the legacyhostcompat group). That's the high-churn part and deserves explicit sign-off on naming/compat rather than being forced autonomously. Nothing here breaks an existing command.Verification
yarn verifygreen: typecheck + lint clean, 1025/1025 tests.backend-id-reconcile.test.ts: backfill-into-topology, already-has-id skip, no-transcript skip, and reconcile-twice idempotency.Scope
Builds on W0 + W2 (merged). No write-layer (W1) or command-name changes.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests