Skip to content

fix: defer non-stream session saves until output guardrails - #4184

Merged
seratch merged 1 commit into
mainfrom
fix/non-stream-output-guardrail-session-persistence
Aug 5, 2026
Merged

fix: defer non-stream session saves until output guardrails#4184
seratch merged 1 commit into
mainfrom
fix/non-stream-output-guardrail-session-persistence

Conversation

@seratch

@seratch seratch commented Aug 5, 2026

Copy link
Copy Markdown
Member

This pull request fixes non-streamed session persistence so assistant output rejected by an output guardrail is not replayed on later turns.

It supersedes the closed #3998. That PR identified the underlying bug, but its branch diverged from current main after #4148 established the shared blocked-output retention behavior, and its split-save approach could lose or reorder mixed final-turn items.

This replacement reuses the retention policy from #4148, persists accepted final turns as one ordered batch, retains committed tool and reasoning records when a tripwire fires, and keeps resumed RunState persistence counts exact. It also preserves the released behavior for ordinary guardrail errors and cancellation.

Co-authored-by: Henry Su <henrysu4707@gmail.com>
@seratch seratch added this to the 0.19.x milestone Aug 5, 2026
@seratch
seratch merged commit 69e2626 into main Aug 5, 2026
9 checks passed
@seratch
seratch deleted the fix/non-stream-output-guardrail-session-persistence branch August 5, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant