test(runtime): send more tools than the composition names - #4777
Closed
Astro-Han wants to merge 1 commit into
Closed
test(runtime): send more tools than the composition names#4777Astro-Han wants to merge 1 commit into
Astro-Han wants to merge 1 commit into
Conversation
The chain test sent a turn with no tools, so the only thing it said about the tool rows was that there were at most 64 of them -- true of a list with none. The cap, the ranking and the remainder crossed the backend, the ledger and the SQLite round trip untested; only the unit fold covered them, on a composition built in memory. It now sends 69, and asserts the same rows the panel reads: 64 named, the five largest-last carried as a counted remainder, and the two adding up to the tool bytes the segment claims -- warm off the committed row, and again cold after reopening the store. Generated-by: Claude Code
Contributor
Author
|
Superseded by #4780 — same commit, opened from a fork branch instead of a branch pushed to apache/maka by mistake. |
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.
Summary
Follow-up to a review point on #4722: the chain test that seals a real send into SQLite sent a turn with no tools, so its only assertion about the tool rows was
tools.length <= 64— which holds for a list with none. The cap, the ranking and the remainder crossed the backend, the AgentRun ledger and the SQLite round trip completely untested; the only coverage was the unit fold inrequest-shape.test.ts, on a composition built in memory.The turn now carries 69 tools, and the test asserts the rows the context panel actually reads:
tool_definitionssegment's own byte count, so nothing is dropped by the cap without being accounted for;Test-only. No production code changes.
✅ Verification
format,lintclean.test:diston@maka/runtime: 3,219 tests, 0 failures.remainder.reduce(...)→0inprompt-composition.ts) fails the test; reverting passes it. Thetools.length === 64assertion is itself the proof the toolset now reaches the sealed row.AI use
Select exactly one:
Tool(s) and scope: Claude Code — wrote the test changes and ran the verification. Reviewed by me.
Checklist
Does this PR entail a change in behavior?