Skip to content

fix: conversation context#14

Merged
ephraimduncan merged 4 commits intomainfrom
fix/conversation-context
Mar 21, 2026
Merged

fix: conversation context#14
ephraimduncan merged 4 commits intomainfrom
fix/conversation-context

Conversation

@ephraimduncan
Copy link
Copy Markdown
Owner

No description provided.

Two bugs caused the agent to lose context from previous messages:

1. Every request generated a fresh conversationId (crypto.randomUUID()),
   so Cursor's server treated each turn as a new conversation.

2. The server's conversationCheckpointUpdate messages were silently
   dropped. This is the canonical conversation state the server sends
   back after each turn, which the client must capture and return
   with subsequent requests.

Fix: store conversationId, checkpoint bytes, and accumulated blobs
per conversation (keyed by model + first user message hash). On
subsequent turns, reuse the stored conversationId and send the
server's checkpoint as conversationState instead of reconstructing
from OpenAI messages. Fall back to client-side reconstruction on
the first turn when no checkpoint exists.

Includes 30-minute TTL eviction and cleanup on stopProxy().
Reuse server checkpoint and blob store between requests so multi-turn
conversations maintain full history without client-side reconstruction.
@ephraimduncan ephraimduncan merged commit 17346be into main Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant