Skip to content

fix: stop streamed tool execution after known input guardrail tripwire#2688

Merged
seratch merged 3 commits intomainfrom
fix/streaming-input-guardrail-tripwire
Apr 15, 2026
Merged

fix: stop streamed tool execution after known input guardrail tripwire#2688
seratch merged 3 commits intomainfrom
fix/streaming-input-guardrail-tripwire

Conversation

@seratch
Copy link
Copy Markdown
Member

@seratch seratch commented Mar 17, 2026

This pull request fixes a streaming-only guardrail race where Runner.run_streamed() could still execute same-turn tool side effects after a parallel input guardrail tripwire had already been observed.

The change keeps the released run_in_parallel=True contract intact for still-running guardrails, but adds a narrow hardening checkpoint for the streaming path once a tripwire is already known. The streaming guardrail runner now records the first triggered result immediately, and streamed turn resolution checks for that state before executing tools or other same-turn side effects.

This also adds regression coverage for the streaming-specific case while preserving the existing tests that document the broader parallel guardrail semantics.

@seratch seratch added this to the 0.14.x milestone Mar 17, 2026
@seratch seratch added bug Something isn't working feature:core and removed project dependencies labels Mar 17, 2026
@seratch seratch force-pushed the fix/streaming-input-guardrail-tripwire branch from c2d0c73 to 15a3045 Compare March 17, 2026 00:30
@github-actions github-actions bot removed bug Something isn't working feature:core labels Mar 17, 2026
@seratch seratch added bug Something isn't working feature:core labels Mar 17, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 15a304514b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/run_internal/guardrails.py Outdated
@github-actions github-actions bot removed bug Something isn't working feature:core labels Mar 17, 2026
@seratch seratch added bug Something isn't working feature:core labels Mar 17, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f03cc1a5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/run_internal/run_loop.py
@github-actions github-actions bot added bug Something isn't working feature:core and removed bug Something isn't working feature:core labels Mar 17, 2026
@seratch seratch modified the milestones: 0.14.x, 0.15.x Mar 27, 2026
@seratch seratch force-pushed the fix/streaming-input-guardrail-tripwire branch from e85ae18 to 623000c Compare April 8, 2026 11:46
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 623000cd98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/run_internal/run_loop.py
m1lestones

This comment was marked as resolved.

@seratch seratch modified the milestones: 0.15.x, 0.14.x Apr 15, 2026
@seratch seratch force-pushed the fix/streaming-input-guardrail-tripwire branch from d111c2f to 25fb1d1 Compare April 15, 2026 18:43
@seratch seratch merged commit fa049a2 into main Apr 15, 2026
9 checks passed
@seratch seratch deleted the fix/streaming-input-guardrail-tripwire branch April 15, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:core skip-stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants