Remove legacy TUI/API fallback paths - #242
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 45 minutes and 24 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 review availability. 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, additional reviews become available more gradually as earlier reviews age out of the rolling window. 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 (2)
📝 WalkthroughWalkthroughThe PR replaces the Changesinbox → coordination & openDashboard screen selection
CLI: live-only project service reads
Sequence Diagram(s)sequenceDiagram
rect rgba(100, 149, 237, 0.5)
note over Client,TmuxClient: coordination action flow
end
participant Client
participant openDashboard as openDashboard handler
participant parseDashboardControlScreen
participant DashboardUIState
participant sendControlAction
participant TmuxClient as tmux-control.sh
Client->>openDashboard: POST /control/open-dashboard {screen: "coordination"}
openDashboard->>parseDashboardControlScreen: validate "coordination"
parseDashboardControlScreen-->>openDashboard: "coordination"
openDashboard->>DashboardUIState: snapshot.screen = "coordination"
openDashboard->>sendControlAction: action="open-dashboard"
sendControlAction->>TmuxClient: run coordination
TmuxClient->>DashboardUIState: persist_dashboard_screen "coordination"
TmuxClient->>TmuxClient: switch-client to dashboard window
openDashboard-->>Client: ControlActionResponse {ok: true}
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/metadata-server.ts (1)
591-605: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse a shared screen allowlist for runtime validation.
DashboardControlScreenis type-only, so this parser repeats the same literals fromsrc/project-api-contract.ts. A future contract change can compile while the server still rejects the new screen. Export a const tuple from the contract and derive both the union and parser from it.Refactor sketch
+export const DASHBOARD_CONTROL_SCREENS = [ + "dashboard", + "coordination", + "project", + "library", + "topology", + "graveyard", +] as const; -export type DashboardControlScreen = "dashboard" | "coordination" | "project" | "library" | "topology" | "graveyard"; +export type DashboardControlScreen = (typeof DASHBOARD_CONTROL_SCREENS)[number];+const DASHBOARD_CONTROL_SCREEN_SET = new Set<string>(DASHBOARD_CONTROL_SCREENS); + function parseDashboardControlScreen(input: unknown): DashboardControlScreen | undefined { if (typeof input !== "string") return undefined; const screen = input.trim(); - if ( - screen === "dashboard" || - screen === "coordination" || - screen === "project" || - screen === "library" || - screen === "topology" || - screen === "graveyard" - ) { - return screen; - } - return undefined; + return DASHBOARD_CONTROL_SCREEN_SET.has(screen) ? (screen as DashboardControlScreen) : undefined; }🤖 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/metadata-server.ts` around lines 591 - 605, The runtime screen validation in parseDashboardControlScreen is duplicating the DashboardControlScreen literals, which can drift from the shared contract. Move the allowlist into src/project-api-contract.ts as an exported const tuple, derive the DashboardControlScreen union from that tuple, and update parseDashboardControlScreen in metadata-server to validate against the shared tuple instead of hardcoded strings.
🤖 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/main.ts`:
- Line 1886: The thread/task read routes still call getProjectServiceJson
directly, so they can bypass ensureDaemonProjectReady and fail when endpoint
metadata is stale. Update the affected read paths in main.ts, including the
thread/task handlers around getProjectServiceJson for /threads, to route through
the same live helper used by worktrees and graveyard so readiness and
version-drift repair always run before the request. Keep the existing route
behavior, but replace the direct project-service read flow with the helper that
performs the daemon readiness check first.
- Around line 479-487: The live project service read path in
getLiveProjectServiceJson can hang indefinitely because requestJson is called
without a timeout. Update the requestJson call in getLiveProjectServiceJson to
pass a finite timeout for these GET requests, using a sensible hard limit so
stalled project services fail fast instead of blocking the CLI forever.
In `@src/tmux/control-script.test.ts`:
- Around line 808-814: The popup assertion in control-script.test should check
the full logged command entry instead of only the bare command name. Update the
expectation around readLog(envRoot) and switch-client so it matches complete
command strings, using the existing log assertions in the test to verify that no
display-popup invocation appears with its arguments rather than just the
substring “display-popup”.
---
Nitpick comments:
In `@src/metadata-server.ts`:
- Around line 591-605: The runtime screen validation in
parseDashboardControlScreen is duplicating the DashboardControlScreen literals,
which can drift from the shared contract. Move the allowlist into
src/project-api-contract.ts as an exported const tuple, derive the
DashboardControlScreen union from that tuple, and update
parseDashboardControlScreen in metadata-server to validate against the shared
tuple instead of hardcoded strings.
🪄 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: 06c1b7ea-bae5-4896-b335-9cb736659fad
📒 Files selected for processing (13)
app/app/(main)/(tabs)/(threads)/threads.tsxapp/app/(main)/global-threads.tsxapp/lib/api.test.tsapp/lib/api.tsscripts/tmux-control.shsrc/main.tssrc/metadata-server.test.tssrc/metadata-server.tssrc/project-api-contract.tssrc/tmux/control-script.test.tssrc/tmux/inbox-popup.tssrc/tmux/runtime-manager.test.tssrc/tmux/runtime-manager.ts
💤 Files with no reviewable changes (1)
- src/tmux/inbox-popup.ts
|
Sub-agent review finding resolved in 47e94b5: thread/task show commands now preserve friendly not-found handling for API 404s without reintroducing local disk fallback reads. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Verification
Summary by CodeRabbit
New Features
Bug Fixes
Refactor