Repository navigation
Conversation
Show each function of a Responses `namespace` tool to the model as `<namespace>__<name>`, like the Python frontend, and report calls of that flat name as a `function_call` with the function name and `namespace`. Named tool choices resolve by the flat name or a function name unique to one namespace, and `function_call` history items with a namespace replay under the flat name. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Isotr0py
approved these changes
Nov 5, 2026
Member
Author
|
/ci run |
|
✅ Triggered Buildkite CI #100220 for commit ℹ️ This PR is 7 commits behind upstream |
richard-for-bugen Bot
added a commit
to BugenZhao/vllm
that referenced
this pull request
Nov 5, 2026
…st frontend vllm-project#65853 added Responses namespace tools to the Rust frontend, so run test_namespace_tool_separator.py in the Responses API step (its directory is already a dependency of the step). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: richard-for-bugen[bot] <342439978+richard-for-bugen[bot]@users.noreply.github.com>
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.
Overview
The Rust frontend rejects every
/v1/responsesrequest that carries anamespacetool (unknown variant 'namespace', 400), so Codex-style clients that group MCP tools under namespaces cannot use it. This PR supports namespace tools the way the Python frontend does (#47024, #53763, #59723).Claims
namespacetool is shown to the model as a flat function tool named<namespace>__<name>, in request order, keeping its description, parameters andstrict.function_callitem with the function's ownnameand itsnamespace, in the non-streaming output and in the streamedoutput_item.added,function_call_arguments.doneandoutput_item.doneevents. The flat name is never exposed.function_callhistory item with anamespaceis replayed under the flat name.tool_choiceresolves by exact name first (including the flat name), then by a function name defined in exactly one namespace; an ambiguous name is a 400 with Python's message.namespacekey instead of serializingnull, like the other optional keys Rust's output items already omit; acustomtool inside a namespace is a 400 instead of being dropped silently, as a top-levelcustomtool already is.Validation
routes::tests::responses::responses_namespace_tool_call_reports_function_name_and_namespace: HTTP route against the mock engine, the model emitting the flatmcp__computer_use__get_app_statecall through the Qwen tool parser; checks the non-streaming output, the streamed events, the terminal response and the echoedtools. Its assertions port those oftests/entrypoints/openai/responses/test_namespace_tool_separator.py.namespace_tools_reach_the_model_by_their_flat_names: the flat tool list, the resolved and echoedtool_choice, and history replay.tools::tests: flattening order and fields, innercustomrejection, the reverse map, and tool-choice resolution (exact, flat, unique local name, ambiguous and missing).On
mainevery request with anamespacetool is a 400; disabling the reverse map or the flattening fails the corresponding tests.test_namespace_tool_separator.pyis server-level and fits the existing Rust Frontend Responses API CI step; it can be enabled there after this lands.Rust CI set (
.buildkite/scripts/run-rust-frontend-cargo-ci.sh) on this branch:Details
Namespaces are a Responses wire concept: the chat layer and the tool parsers only ever see flat function tools. So the naming lives in a new
responses/tools.rsin the Responses route:ToolIdentity { namespace, name }is the client-side identity; itsflat_nameis the only place the__spelling is built.ResponsesToolNames::convertwalks the request tools once, producing the flat tool list handed toResolvedToolContextand a request-local map from each flat name to its namespace length.decodeslices the identity out of a called name, andresolve_choiceresolves a namedtool_choice.OutputItemStreamertakes the map at construction (non-streaming consumes the same streamer), andcreate_responsesbuilds the streamer once for both paths.Like Python, the flattening is a mechanical join without collision handling: a plain tool named
crm__getnext to namespacecrmwith functiongetboth reach the model ascrm__get. The__join reproduces the flat names Codex itself used before namespaces (mcp__<server>__<tool>), and Codex already deduplicates on its side.Not a duplicate. No open PR adds namespace tools to the Rust Responses API; #58783 (draft) predates the stateless Responses API on
mainand does not cover namespaces.AI assistance. This change was developed with AI assistance (Claude Code). The human submitter reviewed every changed line and the validation results.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CJckCByZpUCFtvUEyJQLsA