Repository navigation
Support namespaced function tools in the Responses API - #38359
Open
PierreLeGuen wants to merge 1 commit into
Open
PierreLeGuen wants to merge 1 commit into
PierreLeGuen wants to merge 1 commit into
Conversation
Signed-off-by: Pierre LE GUEN <26087574+PierreLeGuen@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Author
|
@JustinTong0323 Could you review this and enable/rerun the required CI? The Base, Extra, and AMD workflows currently stop at the missing |
4 of 5 tasks
This branch has not been deployed
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.
Motivation
Responses clients such as Codex group client-executed functions under
type="namespace". SGLang accepts these declarations but omits their functions from the chat template, and replay can discard the namespace. This prevents a stateless tool-call loop.Related gateway protocol fixes: smg-project/smg#2451
Modifications
nameandnamespacefields in non-streaming calls and streaming item events, and preserve them on stateless replay.Accuracy Tests
No kernel or model-forward changes. Responses unit tests on the patched serving runtime: 50 passed, 4 subtests passed.
cd test/registered/unit/entrypoints/openai python3 -m pytest -q test_response_namespace_tools.py test_serving_responses.py test_serving_responses_stream.pyLive GLM-5.3-Flash checks passed in both streaming and non-streaming modes: force
weather.lookup, verifynamespace="weather"and the JSON arguments, then replay the returned call with a content-array tool result andstore=false(noprevious_response_id). The next response correctly uses the supplied result. Codex CLI 0.153.0 also completed a namespaced MCP call, replayed its result, inspected and edited a Python file through the shell, passed all three fixture tests, and returned the exact synthetic marker from the MCP result.Speed Tests and Profiling
No inference kernel changes; no throughput claim. The change adds function declaration/name translation at the API boundary.
Checklist
git diff --checkpass for changed files.CI States
Latest PR Test (Base): ❌ Run #34147251332
Latest PR Test (Extra): ❌ Run #34147251186
Latest PR Test (AMD ROCm 7.2): ❌ Run #34147251277