fix: preserve prompt-cache prefix for side conversation forks - #4543
Open
scs0209 wants to merge 3 commits into
Open
fix: preserve prompt-cache prefix for side conversation forks#4543scs0209 wants to merge 3 commits into
scs0209 wants to merge 3 commits into
Conversation
scs0209
force-pushed
the
fix/side-conversation-prompt-cache-prefix-4540
branch
3 times, most recently
from
September 2, 2026 06:44
ba7e847 to
1928bc5
Compare
Move the side-conversation boundary from the system prompt into the first fork-owned user turn and route OpenAI promptCacheKey through the parent session id so fork requests share the parent prefix. Fixes apache#4540 Generated-by: Cursor
Move the side-conversation boundary from the system prompt into the first fork-owned user turn, route OpenAI promptCacheKey through the parent session id, and add a runtime-host regression test that compares parent and fork provider request bodies. Fixes apache#4540 Generated-by: Cursor
scs0209
force-pushed
the
fix/side-conversation-prompt-cache-prefix-4540
branch
from
September 2, 2026 06:58
1928bc5 to
4f71fa4
Compare
- Keep lazy fork-on-first-send behavior from main - Preserve prompt-cache boundary wording from apache#4543 Co-authored-by: Cursor <cursoragent@cursor.com>
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
Side conversation forks injected the boundary into the system prompt, which
changed the prompt-cache prefix relative to the parent session. This moves the
boundary onto the first fork-owned user turn and routes OpenAI
promptCacheKeythrough the parent session id so inherited tools/system/history stay aligned.
Fixes #4540
Verification
npm run lintnpm run format:checknpm --workspace @maka/core run build && npm --workspace @maka/core run test:distnpm --workspace @maka/runtime run buildnpm --workspace @maka/runtime-host run buildnpm --workspace @maka/runtime-host run test:dist(includes side-conversation prompt-cache regression)npm run typecheck(root still fails on unrelated@maka/desktopupstream errors)AI use
Tool(s) and scope: Cursor — implementation, unit tests, and runtime-host regression test.
Checklist
Does this PR entail a change in behavior?