Repository navigation
fix(strata): count tool-call-only answers in the community bench - #223
Merged
Merged
Conversation
The agent session of tools/strata_bench.py offers four tools. When the model answers a turn with a tool call alone, the engine streams only `delta.tool_calls` (no content, and no reasoning with thinking off), so chat() never set the first-token time and the turn was reported as "no token came back", which ended the session. Count a tool_calls delta as an answer as well. The text of the turn stays the content only; the session already continues with "Understood." when a turn has no text. Test: a fake-server mode that answers requests offering tools with tool_calls deltas only; the agent session now completes all turns.
Contributor
Author
|
Thanks for confirming in #222. I pushed the agreed semantics as a separate commit on top, so the change is easy to review:
The fake-server test is kept, and a new test, I'm happy to squash into one commit if you prefer. |
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.
What & why
Fixes #222
tools/strata_bench.pyreportsFAILED: no token came backfor agent-session turns that the model answers with only a tool call. The agent test offers four tools. With thinking off, such an answer streams nothing butdelta.tool_calls:chat()only countsdelta.contentanddelta.reasoning_contentas a token, sofirststaysNone,digest()marks the turn not ok, and the session stops there. The engine did answer: the failed turns had 26–49 generated tokens.I hit this with
edge0-145bon an RTX 3090 at a 16 GiB VRAM budget. 2 of 3 agent sessions failed this way in one run and 3 of 3 in another. At 24 GiB the model happened to answer in text. The same line is in upstream Strata, and the symptom appears in an RX 9070 XT report there (Niko1221/Strata#2876, closed in the tracker reset).The fix follows the semantics agreed in #222:
content,reasoning_content,tool_calls);pieceskeeps counting text only, sogenerated_tokensstill falls back to the engine'susageand never to the number of tool-call chunks.The turn's text stays content only, and the session already falls back to
"Understood."for an empty reply.Area
edge0-infer/)edge0-infer/tools/assets/)edge0-infer/examples/)docs/)edge0-strata/tools/strata_bench.py(the community bench)How was it tested?
SuiteTests.test_a_tool_call_answer_counts_as_an_answer:FakeStratagets a mode that answers requests offering tools withtool_callsdeltas only. It fails before the change with[{'where': 'agent', 'error': 'no token came back'}]and passes after.SuiteTests.test_tool_call_chunks_are_not_counted_as_text:chat()on a tool-call-only answer setsfirst, andpiecesstays 0 (it would be 12 if tool-call chunks were counted).python -m unittest test_strata_benchinedge0-strata/tools/: 24 tests OK.Checklist
ctest --preset cpu -L "L0|L1"passes locally inedge0-infer/(engine changes) — not applicable: no engine changeedge0-infer/docs/testing.md) — the bench's own unit tests, plus the real-engine check above