fix: improve forwarder lifecycle recovery and Cursor transcript sync - #286
Open
philau2512 wants to merge 48 commits into
Open
fix: improve forwarder lifecycle recovery and Cursor transcript sync#286philau2512 wants to merge 48 commits into
philau2512 wants to merge 48 commits into
Conversation
Honor explicit user language requests while retaining IDE defaults and stable prompt replay.
…erience Updated prompt guidelines to prioritize specialized tools over terminal commands for file operations, clarified command examples to avoid assumptions about user environments, and emphasized the use of Read tools for metadata access in terminal files. Adjusted descriptions to ensure clarity and consistency across prompts.
Fix/language policy precedence
Sync upstream
Allow planning artifacts and workflow skills in Plan mode while using hybrid subagent escalation for complex investigations.
- Updated version number to 0.0.43.1 across all relevant files. - Enhanced the build script to include error handling and output verification. - Added a new function to defer transcript synchronization until the conversation turn ends.
…handling - Updated build scripts for both batch and PowerShell to create Windows executables more efficiently. - Introduced a new task for building Windows binaries without creating ZIP archives. - Improved error handling and output verification during the build process.
…ce transcript handling - Fixed an issue where reasoning/progress blocks were duplicated before multiple tools in a single agent run. - Updated the handling of provider reasoning to ensure it is consumed only once per tool invocation. - Added regression tests to verify that reasoning is rendered correctly in transcripts and only once per tool call. - Implemented a fallback mechanism for reasoning content in tool results to maintain historical accuracy.
Sync upstream
…erminal result handling after stream closure
…and update sync logic to skip active turns during backfill - Removed the preserveCursorAppendedTurnEnded function to simplify transcript handling. - Updated SyncAllCursorTranscriptsBestEffort to skip syncing transcripts for active turns. - Added tests to ensure that active turns are not synced during startup backfill and that stale terminal states are correctly handled.
Sync upstream
…ng checkpoint mechanism adjustments and new environment variable for WebView sandbox. Verified successful tests.
…og.json for improved localization accuracy.
Keep shell executions pending until the client reports Run, Skip, or another terminal state, and start foreground recovery only after execution begins.
Keep provider delivery responsive by buffering observability writes and trimming acknowledged stream backlog.
Keep canonical server and tool mappings available across long conversation turns and compaction-driven stream recreation.
Integrate checkpoint projection, imported history, shell streaming, terminal cancellation, provider adapters, localization, and MCP registry compatibility.
Sync upstream 10/08/2026
- rename CHANGELOG_LOCAL.md to CHANGELOG.md - translate historical local changes and verification notes - preserve dates, technical terms, commands, and test names
docs: rename local changelog and translate to English
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR brings the fork's forwarder lifecycle fixes, Cursor transcript synchronization improvements, and prompt/tool compatibility updates back to
leookun/cursor-byok.The changes are cumulative because this branch contains several related fork improvements. The main goal is to make Agent turns, tool execution, shell sessions, cancellation, and transcript projection more reliable under streaming, reconnect, and interrupted-transport scenarios.
Why
The Cursor client can receive events from multiple sources during an Agent turn:
Without strict lifecycle handling, this can result in:
PatchEditorWriteoperations remaining incomplete;This PR addresses these cases while preserving the existing upstream protocol and tool contracts.
Main changes
Forwarder lifecycle and transcript consistency
turn_ended.Tool, edit, and shell recovery
PatchEditandWriteoperations when a turn is canceled.MCP compatibility
Prompt and tool contract updates
alwaysApply: true
response_language: en
lock_response_language: true
Build, localization, and documentation
CHANGELOG.md.Review focus
The most important areas to review are:
internal/backend/forwarder/MCP tool normalization
Prompt/tool contract changes
Validation
The following checks pass:
go build ./...go test ./...go test ./internal/backend/forwarderyarn buildgit diff --cached --checkThe branch is currently
49 files changed, with approximately3317 additionsand369 deletionscompared withupstream/main.Known limitation
go vet ./...still reports the existing lock-copy warning at:internal/backend/agent/bridge/interaction/bridge.go:328This warning is unrelated to the changes in this PR.
E2E validation with the installed Cursor client and a real provider has not yet been completed. The remaining risk is primarily around provider-specific streaming behavior and client-side transcript rendering.