Repository navigation
fix: send the system prompt when resuming a session - #5
Merged
Merged
Conversation
the stored transcript never holds a system message, so a resumed run sent none. build it fresh and put it in front of the stored messages; the session file is untouched.
Balanov
approved these changes
Nov 15, 2026
Balanov
left a comment
Owner
There was a problem hiding this comment.
Thank you for this, and for testing against what the provider actually receives rather than against the transcript on disk. That is the only way to catch this bug: the stored session never had a system message in the first place, so the file looks fine.
Your fix is the minimal one. The system prompt is built fresh on every run and the stored messages are appended after it, and a stored leading system message is dropped rather than duplicated. The session file is not rewritten, which matters here: the transcript stays an append-only record, and your test asserts the file is not rewritten rather than only checking the message list.
Merging this. It ships in the next release.
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.
runPrompt replaced the fresh system message with the stored transcript on --resume, but the jsonl never holds a system message, so a resumed run sent none. now the system prompt is always built fresh and placed before the stored messages. a stored leading system message is replaced, not duplicated. the session file is not rewritten. added a cli test that resumes a session and checks what the provider receives.
Fixes #4