mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#5144
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/4710
Author: @AntonioNoOne
Created: 10/30/2026
Status: 🔄 Open
Base:
main← Head:f-4622-undeclared-tool-calls📝 Commits (1)
e5444d1serve: opt-in "undeclared_tool_calls": "call" returns a call for an undeclared name as a call (#4622)📊 Changes
4 files changed (+55 additions, -4 deletions)
View changed files
📝
docs/DETAILS.md(+2 -1)📝
serve/frontend.py(+10 -2)📝
serve/server.py(+6 -1)📝
serve/test_server.py(+37 -0)📄 Description
Closes the first ask of #4622 (a documented switch for undeclared tool-call names). The second ask (a non-terminal refusal on the default path) is not in this PR.
Problem
Since 0.2.2 (#3075), with tools declared, a well-formed
<function=NAME>for a name the request did not declare comes back as text withfinish_reason: "stop". An OpenAI-shaped harness reads that as a finished answer and ends the turn: nothing runs, no error, no retry. Thestrata_rejected_tool_callsmarker (#3796) helps clients that know it, but a generic client does not.Observed with pi in
codemode(codemode.mode: "only"), which declares one tool,codemode, and lists the other tools inside its description astools.bash(...)etc. On 0.2.7.1 / engine 0.1.52, Qwen3.8-Flash-Next IQ3_S (SC117), the model calls the member directly as<function=tools__bash>. One captured pi request, replayed 3 times, gavetools__bashas text 3/3 and pi ended each run after one turn without running anything.Change
A new config key,
"undeclared_tool_calls":"text"(default, today's behaviour) or"call". With"call"and tools declared, a well-formed call for an undeclared name is returned as a call (tool_calls,finish_reason: "tool_calls"), as before 0.2.2, so the harness can answer with its own unknown-tool error and the model can retry. Only the template's own<function=NAME>form is affected: a drifted opener (#3441) still needs a declared name, and a request that declared no tools is not changed (declared_onlystill applies). Any other value refuses to start the server, liketool_call_recovery.The change is one condition in the parser's well-formed-call branch, the
Serviceattribute, the config read inmain, and one row indocs/DETAILS.mdplus a pointer in the #3796 paragraph.Validation
Revision: this branch on
main; a first version (same well-formed path, without the drifted-opener and no-tools guards) also ran onv0.2.7.1. Windows 11, 2x RTX 3090 24 GB (GPUs 1+2), Qwen3.8-Flash-Next-GSQ-RCO-abliterated IQ3_S, engine 0.1.52.Passed:
python -m unittest serve.test_server.UndeclaredToolCallSwitch(new):"text"keeps the block as text and names it inrejected_tool_calls;"call"returns("tools__bash", {"command": "ls"})and no text;"call"with no tools declared keeps the text. Each fails without the corresponding part of thefrontend.pychange.python -m unittest serve.test_server serve.test_frontend serve.test_reasoning_tools serve.test_reasoning_rescue serve.test_parser_call_scan: 431 tests OK (3 skipped) onmain; 428 OK onv0.2.7.1(before the no-tools test was added).v0.2.7.1+ the first version of this commit (same well-formed path),"undeclared_tool_calls": "call": the same captured pi request replayed 3 times returnedtool_calls: [tools__bash {"command":"ls -la /lavoro/file"}],finish_reason: "tool_calls", 3/3 (before: text, 3/3).tools__bash, pi answeredTool tools__bash not found, the next turn calledcodemodewithawait tools.bash(...)and finished the task.Not run: GPU builds (no C++/CUDA/HIP/SYCL file is touched), the Metal/Mac path,
/v1/messagesand Responses routes on hardware (the parser path is shared; the unit tests cover Chat Completions).🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.