mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3972] [CLOSED] [Engine] accept Codex spellings of a namespace tool #4859
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4859
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3972
Author: @Righteous-AI
Created: 10/24/2026
Status: ❌ Closed
Base:
main← Head:codex-mcp-tool-spellings📝 Commits (2)
6f5d5abserve: accept the other spellings Codex writes for a namespace tool5da438dMerge upstream/main into codex-mcp-tool-spellings📊 Changes
3 files changed (+191 additions, -6 deletions)
View changed files
📝
docs/DETAILS.md(+5 -3)📝
serve/frontend.py(+7 -3)➕
serve/test_tool_name_alias.py(+179 -0)📄 Description
Problem and result: Codex CLI, talking to Strata over the Responses API, stops the turn when Qwen writes a namespace tool under a spelling Strata does not accept. The block comes back as assistant text, so Codex never runs it. Stock main already accepts
namespace__member(PR #3556). This also acceptsnamespace=member,namespace_member, and the bare member when exactly one declared tool has that member.Observed on Strata v0.2.2 (
011c9e60), Codex 0.163, model Qwen3.8-Flash-Next-FP4. The model wrote<function=mcp__filesystem=write_file>,<function=mcp__filesystem_edit_file>, and later a bare<function=write_file>and<function=list_allowed_directories>. The declared tool wasmcp__filesystem.write_file(and the same namespace for the others). After this change those calls come back asfunction_callitems withnamespacemcp__filesystemand the member name.Related discussion: none found for these spellings. #3075 stays as it is: a name that matches nothing is still text, and two namespaces that share a member are not guessed. A Codex turn does end when that text path happens. This PR does not change that rule.
Approach: the alias table in
OutputParseralready rewritesnamespace__memberto the declarednamespace.membername, whichrequest_toolsmaps back to a namespace and a member. The same table now includes the equals form (the<function=tag's equals sign), the one-underscore form, and the bare member. An alias is kept only when one declared tool produces it, and a name that is itself declared wins.Validation:
Passed:
python3 -m unittest serve.test_tool_name_alias serve.test_tool_call_envelope -von6f5d5ab(parent7dd5cf18, Strata main). Python 3.14, jinja2 3.x, no GPU. 20 tests, OK. The new file covers the equals write, the underscore edit with a string argument, barewrite_file(path/tmp/patch-tencut.py), barelist_allowed_directories, the existing double-underscore form, an equals call inside thinking, an unknown name staying text, two namespaces sharingwrite_filestaying text, and a flat tool namedwrite_filewinning over the namespace member.Failed: none in those tests.
Not run: CUDA, HIP, and SYCL builds. This diff is the Python parser and its doc line.
serve.test_responses.ToolRoundTrip.test_namespace_call_written_with_double_underscorewas not run:Serviceimportsstrata_tokenizer, which this checkout does not put on the path, and no engine was started. A live Codex session against this branch was not run. The fixtures are the call text saved from the session above.Limits: an unknown name, and a bare member shared by two namespaces, still come back as text (#3075). Codex ends the turn in that case. Say if that should be a follow-up where the block is a
function_callwith no namespace, so the client can reject it and continue.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.