fix: #2664 drop orphan hosted shell calls before multi-turn replay#2665
Merged
fix: #2664 drop orphan hosted shell calls before multi-turn replay#2665
Conversation
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.
This pull request fixes orphan hosted shell calls being replayed into subsequent model turns when the Responses API returns a
shell_callwithout a matchingshell_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(...)andRunner.run_streamed(...)with hostedShellTool(environment={"type": "container_auto"})so the default path cannot reintroduce the replay bug.