Skip to content

fix: preserve prompt-cache prefix for side conversation forks - #4543

Open
scs0209 wants to merge 3 commits into
apache:mainfrom
scs0209:fix/side-conversation-prompt-cache-prefix-4540
Open

fix: preserve prompt-cache prefix for side conversation forks#4543
scs0209 wants to merge 3 commits into
apache:mainfrom
scs0209:fix/side-conversation-prompt-cache-prefix-4540

Conversation

@scs0209

@scs0209 scs0209 commented Sep 2, 2026

Copy link
Copy Markdown

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 promptCacheKey
through the parent session id so inherited tools/system/history stay aligned.

Fixes #4540

Verification

  • npm run lint
  • npm run format:check
  • npm --workspace @maka/core run build && npm --workspace @maka/core run test:dist
  • npm --workspace @maka/runtime run build
  • npm --workspace @maka/runtime-host run build
  • npm --workspace @maka/runtime-host run test:dist (includes side-conversation prompt-cache regression)
  • npm run typecheck (root still fails on unrelated @maka/desktop upstream errors)

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Cursor — implementation, unit tests, and runtime-host regression test.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, and affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 2, 2026
@scs0209
scs0209 force-pushed the fix/side-conversation-prompt-cache-prefix-4540 branch 3 times, most recently from ba7e847 to 1928bc5 Compare September 2, 2026 06:44
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
scs0209 force-pushed the fix/side-conversation-prompt-cache-prefix-4540 branch from 1928bc5 to 4f71fa4 Compare September 2, 2026 06:58
@github-actions github-actions Bot added effort/L Under 1000 readable lines and removed effort/M Under 500 readable lines labels Sep 3, 2026
- Keep lazy fork-on-first-send behavior from main
- Preserve prompt-cache boundary wording from apache#4543

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/L Under 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(runtime): side-conversation forks must not diverge from the parent's prompt-cache prefix

1 participant