Skip to content

fix: #2664 drop orphan hosted shell calls before multi-turn replay#2665

Merged
seratch merged 1 commit intomainfrom
fix/hosted-shell-orphan-inputs
Mar 13, 2026
Merged

fix: #2664 drop orphan hosted shell calls before multi-turn replay#2665
seratch merged 1 commit intomainfrom
fix/hosted-shell-orphan-inputs

Conversation

@seratch
Copy link
Copy Markdown
Member

@seratch seratch commented Mar 13, 2026

This pull request fixes orphan hosted shell calls being replayed into subsequent model turns when the Responses API returns a shell_call without a matching shell_call_output. It updates the default multi-turn run loop to drop orphan tool calls after normalizing input items in both streamed and non-streamed execution, which keeps the normal path consistent with the existing resumed-session and server-managed conversation defenses. This pull request resolves #2664.

The change is intentionally narrow: hosted shell calls are still preserved in run results for inspection, but they are no longer forwarded back to the model unless a corresponding output item exists. Regression coverage now exercises both Runner.run(...) and Runner.run_streamed(...) with hosted ShellTool(environment={"type": "container_auto"}) so the default path cannot reintroduce the replay bug.

@seratch seratch added this to the 0.12.x milestone Mar 13, 2026
@github-actions github-actions bot added bug Something isn't working feature:core labels Mar 13, 2026
@seratch seratch merged commit 9073d5c into main Mar 13, 2026
9 checks passed
@seratch seratch deleted the fix/hosted-shell-orphan-inputs branch March 13, 2026 15:56
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hosted shell_call without shell_call_output causes "No tool output found" error in multi-turn streaming flow

1 participant