Keep TUI recovery on sidecar transport#283
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?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 reviews. How do review 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 refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughMigrates dashboard-control core command invocations from requestCoreCommand to sendCoreCommand across implementation and tests, adds a lifecycle guard and refresh/render logic fixes in dashboard-api-client and project-event-stream, introduces idempotent event-stream startup in session-launch, switches last-used persistence to atomicWriteFast, and adds a module boundary test. ChangesCore command transport migration
Dashboard refresh lifecycle and event-stream fixes
Last-used persistence and pruning test
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/last-used.ts (1)
115-118: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant
mkdirSynccall.
atomicWriteFastalready creates the target directory internally: "mkdirSync(dirname(path), { recursive: true });" before writing. The explicitmkdirSync(dir, ...)on Line 117 is now dead weight.♻️ Proposed cleanup
function persistLastUsedState(projectRoot: string, state: LastUsedState): void { - const dir = getProjectStateDirFor(projectRoot); - mkdirSync(dir, { recursive: true }); atomicWriteFast(getLastUsedPath(projectRoot), `${JSON.stringify(state, null, 2)}\n`); }🤖 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/last-used.ts` around lines 115 - 118, Remove the redundant directory creation in persistLastUsedState: atomicWriteFast already ensures the target directory exists, so the explicit mkdirSync(dir, { recursive: true }) call is unnecessary. Update persistLastUsedState to rely on atomicWriteFast alone and keep the JSON write path unchanged.src/last-used.test.ts (1)
83-109: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueHand-rolled JSON fixture duplicates the production wire schema.
The test now manually reconstructs the entire
LastUsedStateon-disk shape (version,items,clients.*.recentIds/items/updatedAt,projectRecentIds) via a literal object instead of driving it throughmarkLastUsed/persistLastUsedState. This is faster (fewer persistence cycles, matching the PR's stated goal), but it creates a second, parallel definition of the state schema that must be kept in sync by hand — if the shape insrc/last-used.tschanges (e.g., a field rename or new required field), this fixture can silently drift and either mask a bug or start failing for reasons unrelated to pruning logic.Consider extracting a small
buildSeededLastUsedState(...)test helper co-located with (or exported for) the last-used tests, or seeding through a lower-level exported state constructor instead of a raw literal, so schema changes only need to be updated in one place.🤖 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/last-used.test.ts` around lines 83 - 109, The test is duplicating the persisted LastUsedState schema with a raw JSON literal, which can drift from src/last-used.ts. Refactor this setup to use a shared test helper or lower-level state builder (for example, a buildSeededLastUsedState helper near markLastUsed/persistLastUsedState) so the seeded fixture is generated from the same schema definition instead of manually reconstructing version, items, clients, and projectRecentIds.
🤖 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.
Nitpick comments:
In `@src/last-used.test.ts`:
- Around line 83-109: The test is duplicating the persisted LastUsedState schema
with a raw JSON literal, which can drift from src/last-used.ts. Refactor this
setup to use a shared test helper or lower-level state builder (for example, a
buildSeededLastUsedState helper near markLastUsed/persistLastUsedState) so the
seeded fixture is generated from the same schema definition instead of manually
reconstructing version, items, clients, and projectRecentIds.
In `@src/last-used.ts`:
- Around line 115-118: Remove the redundant directory creation in
persistLastUsedState: atomicWriteFast already ensures the target directory
exists, so the explicit mkdirSync(dir, { recursive: true }) call is unnecessary.
Update persistLastUsedState to rely on atomicWriteFast alone and keep the JSON
write path unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 546aea03-1619-42be-a836-72699edec315
📒 Files selected for processing (9)
src/core-sidecar-boundary.test.tssrc/last-used.test.tssrc/last-used.tssrc/multiplexer/dashboard-api-client.tssrc/multiplexer/dashboard-control.test.tssrc/multiplexer/dashboard-control.tssrc/multiplexer/project-event-stream.test.tssrc/multiplexer/project-event-stream.tssrc/multiplexer/session-launch.ts
|
Sub-agent review findings resolved in e9088ad:
|
|
CodeRabbit nitpicks resolved in d1dfaf6:
|
Summary
Verification
Summary by CodeRabbit