Repository navigation
Python: fix(openai): route unmarked shell call to registered local executor - #8720
Conversation
…ecutor When self hosted Foundry agents emit shell call output items, the environment property is omitted rather than explicitly marked local. Because the local environment check required an explicit local type marker, unmarked calls were misclassified as hosted shell items and skipped by the registered executor. Allow unmarked shell calls to execute via the registered local shell tool when an environment is omitted. Keep explicit non local container environments routed to hosted shell content. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
|
Manohar Paturi (@ManoharPaturi) Any update on this PR? it looks like its been over a week since changes have been made |
|
sorry for the late , please give me time until tomorrow |
|
alkaiserItron Eduard van Valkenburg (@eavanvalkenburg) status: the branch is updated to current main (fb45e94, so the out-of-date banner is cleared) and the new test matrix is running now. on the failing Merge Gatekeeper: that run timed out at 60 minutes waiting on 'Python Tests (3.15, windows-latest)' which was still pending in the queue — succeeded=26, failed=0 at the timeout line. it's a queue/infra timeout on that job, not a test failure. this push starts a fresh run. also noting for reviewers: the local shell tests that fail when running the openai suite on a checkout are failing identically on current main (18 failures on pristine main, same stderr-diagnostics diff — a recent upstream change to exception diagnostics, not this PR). the tests this PR adds are green and unaffected. |
Motivation & Context
Self hosted Foundry agents emitting shell calls omit the environment property on output items rather than providing an explicit local type marker. Under the earlier environment check introduced in openai 1.14.4, any item missing type equal to local was treated as hosted. This caused registered LocalShellTool executors to skip execution, resulting in 400 errors during subsequent continuation turns due to missing tool output.
Description & Review Guide
What are the major changes?
In _shell_item_to_contents within agent_framework_openai._chat_client, the local environment check now accepts unmarked shell calls when a local shell tool name is registered and the environment payload is omitted. Explicit container environments continue to be classified as hosted shell content. Regression unit tests cover both non streaming response parsing and streaming chunk parsing for unmarked items.
What is the impact of these changes?
Local shell tools configured on FoundryChatClient or OpenAIChatClient can resume local execution seamlessly when running against self hosted Foundry backends.
What do you want reviewers to focus on?
Verification that unmarked shell calls properly dispatch to local execution without altering handling for explicit container reference environments.
Related Issue
Fixes #8663
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.