Repository navigation
fix: isolate raw tool payloads in session snapshots - #171
Merged
PsiACE merged 1 commit intoOct 18, 2026
Merged
Conversation
PsiACE
approved these changes
Oct 18, 2026
PsiACE
left a comment
Member
There was a problem hiding this comment.
Thanks for the fix and regression tests!
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.
SessionAccumulatorretains raw tool input/output by reference. Mutating a received notification's nested payload changes the accumulated state and existing snapshots; mutating a returned snapshot likewise changes subsequent snapshots and the source notification. Other tool fields, such as content and locations, are already copied at these boundaries.Deep-copy
raw_inputandraw_outputwhen applying start/progress notifications and when building tool-call snapshots. This keeps nested payload mutations isolated while preserving the existing update/merge semantics and public interfaces. Document the payload-isolation behavior.Four public-API regression cases exercise both notification types and both mutation directions, checking nested input and output payloads, existing snapshots, fresh snapshots, and source notifications. Before the fix, all four fail on base
bdb9ac7; the five existing accumulator tests pass.Validation on Python 3.14.8:
make check: passed (lockfile consistency, all configured prek hooks, full ty and deptry).make test: 412 passed, 1 skipped, including doctests and local stdio/HTTP/WebSocket tests. The optional Gemini CLI smoke test retains its default skip. No model API calls were made.git diff --check: passed.AI assistance: prepared and verified with Codex during a user-authorized contribution search.