mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4670] [Engine] serve: accept the plural ask_user_questions spelling of a declared ask_user_question tool #5133
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#5133
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/4670
Author: @NukeDoggo
Created: 10/30/2026
Status: 🔄 Open
Base:
main← Head:feat/ask-user-question-alias📝 Commits (1)
01fa82e[Engine] serve: accept the plural ask_user_questions spelling of a declared ask_user_question tool📊 Changes
2 files changed (+125 additions, -18 deletions)
View changed files
📝
serve/frontend.py(+71 -16)📝
serve/test_tool_call_envelope.py(+54 -2)📄 Description
Problem and result
Observed with DeepSeek Harness 0.2.1-rc.2 on 2026-10-23 (Qwen3.8-Flash-Next behind a local
Strata build): the harness declares the question tool
ask_user_questionwith a requiredquestionsarray, and the model wrote<tool_call><function=ask_user_questions>…. Under thedeclared-only rule (#3075) Strata returned the block as plain text with
finish_reasonstop, so theharness showed the raw XML instead of its question dialog and the turn had no tool call.
Replaying that exact model output on
870aedd9reproduces it: no tool call, all 1285 charactersreturned as text. With this change the same output yields one tool call named
ask_user_question,and only the 219 characters of prose before the call remain as text. A different name
(
ask_user_question_v2), a missing required argument, or a non-arrayquestionsvalue still staystext.
Related discussion
None. This is a small compatibility fix. An issue can be opened and linked if the maintainers want
the scope agreed first.
Approach
A one-entry alias table (
ask_user_questions->ask_user_question) that applies only when:ask_user_question, andquestionsproperty of type array.The call is parsed against that schema and returned under the declared name. While such a call
streams, no
tool_start/tool_argsevents are emitted until the complete arguments validate; acall that fails validation falls back to text. Declared names always win over the alias, and no
other names are guessed.
The mechanism is routed through the existing alias lookup (
self.aliases/_callable), so itcomposes with the namespace spellings of PR #3556 / #3796 instead of adding a second path.
Validation
Passed:
870aedd9(no change applied): 0 tool calls, 1285 charactersof content, raw XML present — the bug reproduces on the base revision.
ask_user_question(arguments:questions), 219characters of prose, no raw XML — with
stream_toolsboth False and True.python -m pytest serve/test_tool_call_envelope.py serve/test_native_tool_parser.py serve/test_tool_call_unclosed.py serve/test_frontend.py serve/test_tool_name_alias.py serve/test_tool_name_space.py serve/test_parser_call_scan.py serve/test_parser_hold.py serve/test_parser_track.py serve/test_reasoning_tools.py serve/test_structured.py serve/test_responses.py -q-> 157 passed (revision
870aedd9+ this change, Windows, Python 3.12.3).python -m pytest serve/test_server.py -q-> 356 passed, 3 skipped (same revision).
Failed:
Not run:
written); the replay above feeds the exact bytes the model produced.
serve/suite was not re-run after this change; the changes are limited to thetool-call parser and its tests.
Limits
ask_user_question; a general spelling-fuzzy match is notattempted. If a generic rule is preferred (for example accepting a trailing
son any declaredtool whose schema matches), this can be generalized in review.
pair; the same code path applies to any client that declares a tool whose name a model may
pluralize.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.