-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix(sessions): preserve writes that land while responses.compact is in flight #4680
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
Open
Om-singhaI
wants to merge
14
commits into
openai:main
Choose a base branch
from
Om-singhaI:fix/compaction-concurrent-write-loss
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8dd60cf
fix(sessions): preserve writes that land while responses.compact is i…
Om-singhaI e0566c1
fix(sessions): detect empty snapshot clears and pin the response id a…
Om-singhaI 868becf
fix(sessions): count a compaction replacement as a history rewrite
Om-singhaI 8acf6c3
Merge remote-tracking branch 'origin/main' into fix/compaction-concur…
Om-singhaI 49f34b9
Merge remote-tracking branch 'origin/main' into fix/compaction-concur…
Om-singhaI 833ed99
fix(sessions): preserve turns persisted after a response's recorded b…
Om-singhaI c755d21
fix(sessions): skip compaction when a recorded boundary has been dropped
Om-singhaI 901a543
fix(sessions): compute response boundaries before the batch append
Om-singhaI 21768f2
fix(sessions): harden compaction edge paths and simplify boundary boo…
Om-singhaI 439dc29
fix(sessions): record response boundaries only for writes the run owns
Om-singhaI 2fa608c
fix(sessions): record no boundary when the request input skips history
Om-singhaI bb5f52a
fix(sessions): arm the gate for stale tokens and void filter rewrites
Om-singhaI 225ee41
fix(sessions): void nested handoff rewrites and arm the gate before a…
Om-singhaI 7bfbb96
fix(sessions): void ownership on any short request history read
Om-singhaI 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
447 changes: 385 additions & 62 deletions
447
src/agents/memory/openai_responses_compaction_session.py
Large diffs are not rendered by default.
Oops, something went wrong.
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.
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.
When a
SandboxAgentcapability uses the publicCapability.process_context()hook to filter stored history,sandbox_runtime.prepare_agent()replacesoriginal_inputafter the token was captured, but this unchanged token is still forwarded here. The following persist can therefore record a boundary covering the full session even though the model request omitted part of it, andprevious_response_idcompaction can silently delete that omitted prefix. Invalidate the token whenever sandbox preparation rewrites the input, as is already done for the other input-filtering hooks; the streamed path has the same stale-token forwarding.AGENTS.md reference: AGENTS.md:L147-L149
Useful? React with 👍 / 👎.