fix: harden TUI API recovery states#269
Conversation
|
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdates app release/auth startup handling and changes dashboard settlement, recovery, runtime-guard, caching, and restart flows across the multiplexer and related tests. ChangesApp release config and auth
Dashboard, multiplexer, and runtime behavior
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Independent review finding (by design):
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/multiplexer/persistence-methods.ts`:
- Around line 942-957: The fallback worktree seed lookup in persistence-methods
should be best-effort so it cannot break removal flow. In the worktree removal
path around the cachedWorktree/listedWorktree logic, wrap the
listDesktopWorktrees() call and the derived find lookup so any exception is
swallowed and worktreeAction setup still continues. Keep the
pendingRemovals/setWorktreeAction state updates in place and ensure the removal
promise cannot remain unsettled if the seed lookup fails.
In `@src/multiplexer/worktrees.ts`:
- Around line 74-78: findRawWorktreeForSettlement currently assumes either
dashboardRawWorktreeGroupsCache or dashboardWorktreeGroupsCache is always an
array, so calling .find can throw when both are unset. Update this helper to
guard the fallback cache in the same way beginWorktreeRemoval treats it as
optional: if neither cache is an array, return undefined before searching, and
keep the same lookup logic using sameWorktreePath and the WorktreeHost cache
fields.
- Around line 94-115: The stable-absence wait in
waitForStableDashboardWorktreeAbsence is bailing out too early when
refreshDashboardModelForWorktreeSettlement returns false on an unchanged
snapshot, which prevents the stable window from completing. Update the loop so
an unchanged refresh does not immediately return false; instead keep polling and
only fail on an actual refresh/lifecycle error, while preserving the
missingSince timing and the findRawWorktreeForSettlement check for path
disappearance.
In `@src/runtime-restart.ts`:
- Around line 376-383: Use the already resolved dashboard session instead of
recomputing it in cleanupHostDashboardSession(); the current call to
tmux.getProjectSession(projectRoot).sessionName can drift from the authoritative
resolvedTarget.dashboardSession.sessionName. Update
cleanupHostDashboardSession() (and the other matching call site) to accept and
pass through the resolved dashboard session name from the target/restart
resolution path, then use that value when calling cleanupStaleDashboardLinks so
stale windows are cleaned from the correct session.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b962ee52-7bda-45d5-88c6-05422ab0e5e3
📒 Files selected for processing (33)
app/eas-release.config.jsonapp/lib/auth.tsxapp/lib/version.tsapp/package.jsonapp/scripts/check-release-env.jssrc/dashboard/pending-actions.test.tssrc/dashboard/pending-actions.tssrc/metadata-server.test.tssrc/metadata-server.tssrc/multiplexer/dashboard-control.test.tssrc/multiplexer/dashboard-interaction.test.tssrc/multiplexer/dashboard-interaction.tssrc/multiplexer/dashboard-model-service.test.tssrc/multiplexer/dashboard-model.tssrc/multiplexer/dashboard-ops.test.tssrc/multiplexer/dashboard-ops.tssrc/multiplexer/index.tssrc/multiplexer/persistence-methods.test.tssrc/multiplexer/persistence-methods.tssrc/multiplexer/project-event-stream.test.tssrc/multiplexer/project-event-stream.tssrc/multiplexer/runtime-guard.test.tssrc/multiplexer/runtime-guard.tssrc/multiplexer/session-launch.test.tssrc/multiplexer/tui-api-runtime.test.tssrc/multiplexer/tui-api-runtime.tssrc/multiplexer/tui-runtime-mutations.test.tssrc/multiplexer/tui-runtime-mutations.tssrc/multiplexer/worktrees.test.tssrc/multiplexer/worktrees.tssrc/runtime-restart.test.tssrc/runtime-restart.tssrc/tui/screens/overlay-renderers.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/multiplexer/worktrees.test.ts`:
- Around line 861-877: The test around beginWorktreeRemoval should explicitly
verify the intermediate state after the first refreshDashboardModelFromService()
returns false, instead of only asserting the final success path. Update the
scenario in src/multiplexer/worktrees.test.ts to check that footerFlash is still
empty and the worktreeRemovalJob remains set before applyRawWorktrees clears the
pending worktrees, using the existing beginWorktreeRemoval,
attachPendingReapply, and refreshDashboardModelFromService setup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: adfe0b59-5c17-4ab1-9b0c-c1057fcccf45
📒 Files selected for processing (6)
src/multiplexer/persistence-methods.test.tssrc/multiplexer/persistence-methods.tssrc/multiplexer/worktrees.test.tssrc/multiplexer/worktrees.tssrc/runtime-restart.test.tssrc/runtime-restart.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/runtime-restart.test.ts
- src/multiplexer/worktrees.ts
- src/multiplexer/persistence-methods.ts
|
Independent sub-agent review found one medium issue: event-driven TUI refreshes were using the non-forced desktop-state path, which could consume stale cached state after a real SSE update. Fixed in 20eef28 by forcing dashboard model refreshes for project-event refreshes and updating the project-event-stream regression tests. |
Summary
aimux restartinstead of zombie waitingValidation
Summary by CodeRabbit
New Features
Bug Fixes
Chores
.env.localhandling for release environment checks.