Repository navigation
test(harness): pin the actionable error text for unrepairable tool args - #586
Conversation
With ArgRecoveryMiddleware installed, an unrepairable provider-invalid call must still reach admission with its raw string and be answered with the "not valid JSON ... Re-send it as well-formed JSON" corrective.
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): test(harness): pin the actionable error text for unrepairable tool args. Tiny Sweeper completed its review; deterministic results follow. Review snapshot
Completeness: Complete Features
TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Before mergeNone. Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Middleware recovery regression test crates/tinyagents-harness/src/agent_loop/mod_tests.rs |
Adds a test that checks the run result, confirms the tool is not called, and verifies both corrective transcript messages. |
Priority:
Estimated code review effort: 1 (Trivial) | ~4 minutes
Change: Other
Possibly related issues
- tinyhumansai/openhuman issue 6999: The test covers rejected tool calls and checks for corrective text when malformed arguments cannot be repaired.
Possibly related PRs
- tinyhumansai/tinyagents#584: This PR adds middleware-installed regression coverage for the argument recovery behavior and corrective text changed in that PR.
Suggested reviewers: senamakel
Merge Risk: 
Minimal · up to f8bdf
-
No merge-blocking risk was identified in this test-only change.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
A rabbit checks the tool-call trail,
The broken arguments cannot prevail.
No tool runs on malformed fare,
A parse error and resend guide appear.
The transcript keeps the answer clear.
Comment @coderabbitai help to get the list of available commands.
What
Adds
arg_recovery_keeps_the_actionable_error_text_for_unrepairable_argumentstoagent_loop/mod_tests.rs. It runs the agent loop withArgRecoveryMiddlewareinstalled, the way the host stack does, and sends a provider-invalid tool call that relaxed-JSON repair cannot fix ({"query": [1 2]}). It asserts that:lookupwas not run: its arguments are not valid JSON", plus "Re-send it as well-formed JSON that matches the tool's argument schema".The existing
unrepairable_arguments_are_answered_with_an_actionable_errorruns without the middleware, and only checks "invalid JSON arguments" and the schema phrase. It never checks the "not valid JSON" / "Re-send" text that the model acts on.Revert check (cuttlefish, at 53464e9)
unparseable_tool_call_message(tools.rs) makes the test fail at the Re-send assert. Restoring the file makes it pass.ArgRecoveryMiddleware's provider-invalid branch (if false && call.invalid.is_some()) leaves the test passing: the loop's own unparseable-call path still produces the same text. So the test pins the wording, not which layer produces it, and its doc comment says so.Checks (cuttlefish, at f8bdfcc)
cargo fmt --all --check: cleanagent_loop::at 53464e9: 541 passed, 0 failedcargo clippy -p tinyagents-harness --tests -- -D warnings: exit 0Test-only change: +43 lines in one file.
Summary by CodeRabbit