feat(voice): preserve context across sequential turns - #9412
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan includes up to 12 reviews per rolling hour; 11 remain after this review. 📝 WalkthroughWalkthroughVoice Gateway session keys are now deterministically derived from trusted runtime bindings. Tests verify key reuse, isolation, context continuity across admissions, internal key hiding, and rejection of invalid caller-controlled values. ChangesVoice session context
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The change preserves voice-call context across sequential turns while isolating new conversations; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant VoiceRuntime
participant VoiceSessionService
participant PinnedOpenClawGateway
participant OpenClaw
VoiceRuntime->>VoiceSessionService: Submit runtime conversation and trusted binding
VoiceSessionService->>VoiceSessionService: Derive internal session key
VoiceSessionService->>PinnedOpenClawGateway: Admit turn with derived key
PinnedOpenClawGateway->>OpenClaw: Send turn with session key
OpenClaw-->>PinnedOpenClawGateway: Return contextual response
PinnedOpenClawGateway-->>VoiceRuntime: Return assistant response
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
jyaunches
left a comment
There was a problem hiding this comment.
LOC Reduction / Codebase Simplicity Review
Why this blocks
test/voice-gateway-integration.test.ts:362-433 adds two standalone admission-rejection tests. Each recreates the same VoiceSessionService, clientsCreated counter, HTTP server, and listener setup at lines 364-379 and 403-418. The existing authority-boundary test immediately below already owns that setup at lines 435-454 and already proves that caller-selected admission fields are rejected before createClient.
The two new tests total 71 lines even though their distinct behavior is only three request bodies and their expected invalid_request responses.
Refactor direction
Fold the malformed conversation ID, oversized conversation ID, and caller-supplied sessionKey bodies into the existing admission-authority test, preferably as one small table. Reuse its single service and server, assert each exact 400 response, then keep one clientsCreated === 0 assertion before the existing valid admission.
Keep the composed context-reuse test and pinned OpenClaw context fixture; they cover distinct #9411 behavior and do not need another abstraction.
Expected result
All three rejection cases still prove fail-before-client behavior, while the duplicated setup disappears. This should remove roughly 40 lines from the +155/-3 integration-test change and leave one test owner for the HTTP admission authority boundary.
PR Review Advisor — Blocking findings reportedAdvisor assessment: Blockers require maintainer review Model lanes
5 terminology differences from the second opinionAdvisory only. These are normalized differences from the primary terminology receipt.
Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests. 2 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. A maintainer can dispatch the default E2E suite for the commit under review. Recommended E2E: None Blockers
|
|
Addressed in
Validation:
|
Summary
Voice Gateway admissions now derive an internal OpenClaw session key from the configured agent, runtime profile, runtime identity, and validated
runtimeConversationId. Sequential one-turn admissions for one voice call reuse OpenClaw context, while a new conversation or configured binding receives a separate context.Related Issue
Fixes #9411
Changes
nemoclaw-voicenamespace.Type of Change
Quality Gates
DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpx vitest run --project cli --project integration src/lib/voice-gateway/session-service.test.ts test/voice-gateway-integration.test.tspassed 2 files and 17 tests.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — Not run; the change is limited to one service and its focused integration fixture.npm run docsbuilds without warnings (doc changes only)Signed-off-by: San Dang sdang@nvidia.com
Summary by CodeRabbit
New Features
Bug Fixes