Repository navigation
Phase 3: Testing wiring (CLI process, ACP mock-runtime, hooks) - #37
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 49 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)
📝 WalkthroughWalkthroughAdds Phase 3 testing infrastructure for ACP prompt streams, CLI process integration, optimistic hooks cache updates, and mocked RTC data channels, along with package scripts, Bun type configuration, and testing documentation updates. ChangesPhase 3 testing
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant WiringTest
participant runTurn
participant threadCoordinator
participant MockPromptStream
WiringTest->>runTurn: execute turn
runTurn->>threadCoordinator: call prompt
threadCoordinator->>MockPromptStream: request events
MockPromptStream-->>threadCoordinator: token and message_completed
threadCoordinator-->>runTurn: return prompt result
runTurn-->>WiringTest: Ok result and event sequence
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a7aed5f to
83d89a6
Compare
Introduce mock ACP prompt streams, CLI login-gate integration coverage, optimistic thread cache tests, and mock data-channel helpers for PR CI WebRTC paths. Co-authored-by: Cursor <cursoragent@cursor.com>
1d00c66 to
3eb4f21
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
apps/cli/__tests__/integration/wiring.test.ts (1)
35-39: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valuePrefer a typed partial mock over
as never.
as neveris a valid escape hatch but obscures intent. APartial<Runtime>cast or a dedicated mock factory would make it clearer that onlythreadCoordinator.promptis being stubbed, and would catch future contract changes at compile time.🤖 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 `@apps/cli/__tests__/integration/wiring.test.ts` around lines 35 - 39, Replace the `as never` cast in the `runtime` mock with a typed partial mock, such as `Partial<Runtime>`, or use a dedicated mock factory that explicitly stubs only `threadCoordinator.prompt`. Preserve the existing `createMockPromptStream` behavior while ensuring future `Runtime` contract changes are checked by the type system.
🤖 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 `@apps/cli/__tests__/helpers/acp-runtime.ts`:
- Around line 9-26: Add a test in the existing runTurn wiring tests that invokes
createMockPromptStream with failAfterToken enabled, verifies the thrown runtime
error is handled, and asserts that the emitted event sequence includes
turn_interrupted rather than successful completion. Use the existing test
helpers and assertions in wiring.test.ts.
In `@apps/cli/__tests__/integration/wiring.test.ts`:
- Around line 64-65: In the child-process options for the integration test,
change both stdout and stderr from "pipe" to "ignore" so output is not buffered
in unread streams; preserve the existing exit-code assertions and other process
configuration.
In `@tooling/test/mocks/data-channel.ts`:
- Around line 1-59: Add the DOM library to the compiler configuration in
tooling/typescript/tsconfig.base.json so tooling/test/mocks/data-channel.ts
resolves RTCDataChannelState, Event, and EventListener while retaining the
existing Bun type configuration.
---
Nitpick comments:
In `@apps/cli/__tests__/integration/wiring.test.ts`:
- Around line 35-39: Replace the `as never` cast in the `runtime` mock with a
typed partial mock, such as `Partial<Runtime>`, or use a dedicated mock factory
that explicitly stubs only `threadCoordinator.prompt`. Preserve the existing
`createMockPromptStream` behavior while ensuring future `Runtime` contract
changes are checked by the type system.
🪄 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: 3d1b136f-3aa3-4f44-9ecd-097b30477945
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (9)
apps/cli/__tests__/helpers/acp-runtime.tsapps/cli/__tests__/integration/wiring.test.tsapps/cli/package.jsondocs/testing.mdshared/hooks/package.jsonshared/hooks/src/connection/use-controller-threads.test.tsshared/hooks/tsconfig.jsontooling/test/mocks/README.mdtooling/test/mocks/data-channel.ts
Cover the mock interruption path, avoid hanging CLI spawn pipes, and keep data-channel mocks free of shared DOM tsconfig changes. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed CodeRabbit review in the latest push:
Skipped:
|
Implements #32
Summary
runTurnTest plan
bun test:unitbun test:integrationbun check:typesStacked on #36
Closes #32
Part of #29
Summary by CodeRabbit
Tests
Documentation
Chores