Add coherent aimux restart flow#199
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 25 minutes and 16 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds two new TypeScript modules— ChangesRuntime Coherence, Restart, and CLI
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI as aimux restart / doctor versions
participant restartAimuxControlPlane
participant buildRuntimeCoherenceReport
participant TmuxRuntimeManager
participant ProjectService as per-project /health
participant DaemonControl as stop/ensureDaemon
User->>CLI: aimux restart [--project path]
CLI->>restartAimuxControlPlane: call({projectRoot?})
restartAimuxControlPlane->>buildRuntimeCoherenceReport: collect daemon state + tmux sessions
buildRuntimeCoherenceReport->>TmuxRuntimeManager: list sessions/windows
buildRuntimeCoherenceReport->>ProjectService: GET /health (1000ms timeout) per project
ProjectService-->>buildRuntimeCoherenceReport: serviceInfo or error
buildRuntimeCoherenceReport-->>restartAimuxControlPlane: RuntimeCoherenceReport
restartAimuxControlPlane->>DaemonControl: stopDaemon → ensureDaemonRunning
loop each target project
restartAimuxControlPlane->>ProjectService: ensureProjectService
restartAimuxControlPlane->>TmuxRuntimeManager: resolveDashboardTarget(forceReload:true)
end
restartAimuxControlPlane-->>CLI: RuntimeRestartResult
CLI->>User: renderRuntimeRestartResult or JSON
Note over User,CLI: aimux doctor versions
User->>CLI: aimux doctor versions
CLI->>buildRuntimeCoherenceReport: build report only
buildRuntimeCoherenceReport-->>CLI: RuntimeCoherenceReport
CLI->>User: renderRuntimeCoherenceReport or JSON
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 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 unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/runtime-coherence.test.ts (1)
50-132: ⚡ Quick winAdd a runtime-owner mismatch regression test.
Current coverage validates service/build-stamp drift, but not
TMUX_RUNTIME_OWNER_OPTIONdrift. Add a case where session runtime owner differs from expected and assert dashboard/project status becomemismatch/needs-restart.🤖 Prompt for 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. In `@src/runtime-coherence.test.ts` around lines 50 - 132, Add a third test case within the "runtime coherence report" describe block that validates runtime owner mismatch detection. The test should call buildRuntimeCoherenceReport with getRuntimeOwnerId returning one owner value (e.g., "owner-new") and getProjectServiceManifest returning a serviceInfo object with a different runtimeOwner value (e.g., "owner-old"). Assert that the resulting report shows dashboard and project status as "mismatch" and needsRestart count increases appropriately, similar to the existing test structure for buildStamp mismatches.
🤖 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/runtime-coherence.ts`:
- Around line 225-228: The status evaluation in the ternary operator that checks
"ok" versus "mismatch" is missing validation of the runtimeOwner variable
(captured on line 212) against input.expectedRuntimeOwner. Add a check for
runtimeOwner equality to the condition alongside the existing checks for alive,
buildStamp, and owner to ensure the dashboard coherence evaluation properly
validates the runtime owner. Apply the same fix to the similar status assignment
at lines 374-375.
---
Nitpick comments:
In `@src/runtime-coherence.test.ts`:
- Around line 50-132: Add a third test case within the "runtime coherence
report" describe block that validates runtime owner mismatch detection. The test
should call buildRuntimeCoherenceReport with getRuntimeOwnerId returning one
owner value (e.g., "owner-new") and getProjectServiceManifest returning a
serviceInfo object with a different runtimeOwner value (e.g., "owner-old").
Assert that the resulting report shows dashboard and project status as
"mismatch" and needsRestart count increases appropriately, similar to the
existing test structure for buildStamp mismatches.
🪄 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: 83fbf534-8c40-484f-b31f-c17f6454baa0
📒 Files selected for processing (9)
AGENTS.mdREADME.mddocs/current-architecture.mddocs/runtime-lifecycle.mdsrc/main.tssrc/runtime-coherence.test.tssrc/runtime-coherence.tssrc/runtime-restart.test.tssrc/runtime-restart.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
aimux doctor versionsaimux restartto restart daemon/services and reload existing dashboards without killing agent tmux windowsaimux daemon restartthrough the coherent restart pathVerification
restart,doctor versions, andrestart --helpSummary by CodeRabbit
Release Notes
New Features
aimux restartcommand to coherently restart the local control plane with optional project scoping.aimux doctor versionscommand to inspect daemon/project/dashboard version coherence.Documentation