Centralize TUI API adapter usage - #230
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@coderabbitai review |
|
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)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughIntroduces ChangesDashboard API Client Abstraction and Migration
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 docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/multiplexer/tui-api-runtime.test.ts (1)
228-234: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd an assertion for the
opts !== undefinedmutate branch.This test currently validates only the no-opts path, but the runtime change introduced a separate branch when opts are provided.
Suggested test update
await expect(runtime.mutateJson("/agents/stop", { sessionId: "b" }, (value) => value)).resolves.toMatchObject({ ok: true, value: { ok: true, body: { sessionId: "b" } }, }); + const opts = { timeoutMs: 10_000 }; + await expect( + runtime.mutateJson("/agents/stop", { sessionId: "c" }, (value) => value, opts), + ).resolves.toMatchObject({ + ok: true, + value: { ok: true, body: { sessionId: "c" } }, + }); expect(mutate).toHaveBeenCalledTimes(1); expect(host.postToProjectService).toHaveBeenCalledWith("/agents/stop", { sessionId: "b" }); + expect(host.postToProjectService).toHaveBeenCalledWith("/agents/stop", { sessionId: "c" }, opts);🤖 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/multiplexer/tui-api-runtime.test.ts` around lines 228 - 234, The test for runtime.mutateJson currently validates the response and service call but does not verify that the opts callback function is actually invoked when opts are provided. Add an assertion to verify that the opts callback function (the third parameter passed to mutateJson) was called with the correct value, ensuring the opts !== undefined branch in the runtime implementation is properly tested and exercised.
🤖 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/dashboard-control.ts`:
- Line 317: The condition at line 317 in the refreshDashboardModelThroughApi
call currently treats all false returns as repair failures, but the function
also returns false when the host is no longer in dashboard mode due to user
navigation, which is not an actual repair failure. Modify the logic to
distinguish between actual API failures and stale lifecycle state changes,
ensuring that repair is only marked as failed when there is a genuine API error
(not when the host has exited dashboard mode). This may require checking the
return value more carefully or adding additional state information to understand
whether the false return indicates a real failure versus a benign state change.
---
Nitpick comments:
In `@src/multiplexer/tui-api-runtime.test.ts`:
- Around line 228-234: The test for runtime.mutateJson currently validates the
response and service call but does not verify that the opts callback function is
actually invoked when opts are provided. Add an assertion to verify that the
opts callback function (the third parameter passed to mutateJson) was called
with the correct value, ensuring the opts !== undefined branch in the runtime
implementation is properly tested and exercised.
🪄 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: aa9209bb-8e78-415f-b03e-c8214ff2b958
📒 Files selected for processing (27)
src/multiplexer/archives.tssrc/multiplexer/coordination.tssrc/multiplexer/dashboard-api-client.test.tssrc/multiplexer/dashboard-api-client.tssrc/multiplexer/dashboard-control.test.tssrc/multiplexer/dashboard-control.tssrc/multiplexer/dashboard-interaction.test.tssrc/multiplexer/dashboard-interaction.tssrc/multiplexer/dashboard-ops.tssrc/multiplexer/dashboard-view-methods.tssrc/multiplexer/index.tssrc/multiplexer/library.test.tssrc/multiplexer/library.tssrc/multiplexer/notifications.tssrc/multiplexer/project-event-stream.tssrc/multiplexer/project.test.tssrc/multiplexer/project.tssrc/multiplexer/runtime-state.tssrc/multiplexer/session-launch.test.tssrc/multiplexer/session-launch.tssrc/multiplexer/session-runtime-core.tssrc/multiplexer/subscreens.tssrc/multiplexer/topology.test.tssrc/multiplexer/topology.tssrc/multiplexer/tui-api-runtime.test.tssrc/multiplexer/tui-api-runtime.tssrc/multiplexer/worktrees.ts
Summary
Verification
Summary by CodeRabbit
Release Notes
Refactor
Bug Fixes
Tests