fix(cursor): pin session id and continue external tool results as userMessageAction (lands #1990) - #2017
Conversation
Reuse the resolved conversationId as Connect x-session-id so transport rebuilds for the same client thread keep one session identity. Fall back to a random UUID only when no session identity exists. Native-exec/background shells use a separate per-transport owner (see follow-up commit).
…ction Drive external-model tool-result hops as userMessageAction so history-blob tool results stay visible without ResumeAction. Native models keep resumeAction. Live Connect probes informed this encoding choice; unit tests only lock the action case.
Independent review: do not claim the 429 diagnosis from unit tests, keep native-exec/background shells on a per-transport owner so overlapping turns cannot reap each other, and lock sessionId forwarding in adapter plus Connect header tests.
# Conflicts: # tests/cursor-blob.test.ts
|
✅ Deterministic PR hygiene checks passed. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughCursor now preserves conversation IDs across transport rebuilds, separates Connect session IDs from shell ownership IDs, and sends explicit continuation text for external-model tool-result replays. Tests cover session propagation, header transmission, ownership isolation, and continuation history. ChangesCursor session continuity
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CursorTurn
participant CursorTransportFactory
participant LiveCursorTransport
participant NativeExecution
CursorTurn->>CursorTransportFactory: pass conversation ID as sessionId
CursorTransportFactory->>LiveCursorTransport: create transport with sessionId
LiveCursorTransport->>NativeExecution: use shellOwnerId for execution context
LiveCursorTransport->>NativeExecution: clean up shells by shellOwnerId
sequenceDiagram
participant CursorRequest
participant ProtobufRequest
participant ExternalModel
CursorRequest->>ProtobufRequest: provide tool-result history
ProtobufRequest->>ProtobufRequest: select continuation text
ProtobufRequest->>ExternalModel: send userMessageAction with continuation text
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 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 |
Summary
Lands contributor PR #1990 (laerad777) on current
dev: the cursor live transport pins one stable session id per logical conversation (wasrandomUUID()per request, so server-side thread reuse never engaged), and external tool results continue asuserMessageAction. The one test conflict against #1997's assistant-role assertions is composed (both assertions kept).Verification
tsc --noEmitcleanChecklist
Summary by CodeRabbit
Bug Fixes
Tests