-
Notifications
You must be signed in to change notification settings - Fork 52.6k
CLI keeps the api_content sidecar when a turn was persisted early — prompt cache survives (#102194, salvage #102411) #105842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kshitijk4poor
merged 4 commits into
NousResearch:main
from
kshitijk4poor:salvage/p0-102194
Sep 9, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
133998b
fix(agent): row-addressed api_content backfill for pre-persisted user…
JoaoMarcos44 9cfbeb0
fix(agent): read the sidecar row id under the session persist lock
kshitijk4poor 859bcd6
refactor(agent): one durable-row rule for the flush and the sidecar s…
kshitijk4poor a1c3d92
simplify(agent): sidecar backfill — drop the hasattr guard and the du…
kshitijk4poor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Match the representation written by compaction, not always the flush override
durable_user_row_content()computes the content that_db_flush_rowwould write, but an in-place preflight compaction does not go through that writer._commit_compactionpassescompresseddirectly toarchive_and_compact;_message_row_paramsinsertsmsg['content']without the agent's clean override.For a surviving current user message with live content
[voice] hello,_persist_user_message_override='hello', and plugin contextPLUGIN-CTX, compaction therefore inserts[voice] helloand stamps its_row_id. This helper selectshelloasdurable_content, so the subsequent row-addressedUPDATE ... AND content IS ?affects 0 rows.api_contentexists on the live dict, but remains NULL in SQLite; the compaction persistence marker then makes the ordinary flush skip it. A later reload drops the injection and breaks the request-prefix invariant this PR is repairing. The previous compaction backfill matched the live content and did not have this failure. The positional compaction fallback receives the same wrong guard value here as well.The isolated SQLite counterexample and a production-import regression test are in the review body. Preserve row addressing and all SQL guards, but distinguish the compaction writer's committed representation from the ordinary flush projection, or make those writers genuinely share the same projection. Cover compaction + differing persist override + injection together, while retaining the passing clean early-flush cases. Do not repair the zero-row result by removing the content guard or trying an unrelated newest row.