fix(prompt): keep plan/build reminders stable#27867
Open
namnguyen0503 wants to merge 1 commit into
Open
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Based on the search results, I found two related PRs that might be addressing similar issues:
Why they might be related:
You may want to check if PR #26743 has already been merged or if there's any overlap in the fixes being applied. |
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.
Issue for this PR
Closes #26749
Type of change
What does this PR do?
Fixes Plan/Build
<system-reminder>prompt-history drift.Previously, a historical user message could be serialized once as
Continueplus the Plan -> Build reminder, then later serialize as onlyContinue. That changes already-seen model input and breaks prefix cache stability for llama.cpp, vLLM, LM Studio, and other prefix-caching backends.This PR anchors the reminder to a stable turn boundary and avoids mutating historical message parts during prompt construction.
How did you verify your code works?
Ran:
bun test test/session/prompt.test.ts -t "keeps plan/build system reminders anchored to the original user turn across later serializations"bun test test/session/prompt.test.ts -t "static loop consumes queued replies across turns"bun test test/session/prompt.test.tsbun turbo typecheckAll passed.
Also ran a source-checkout smoke test with the repo fake OpenAI-compatible TestLLMServer. It verified that the historical
Continue + <system-reminder>message stayed byte-stable across a later Build turn.Screenshots / recordings
Not applicable. This is a prompt serialization bug fix covered by tests.
Checklist