fix: parameter guidance, shell-reflex interception, and output contracts in tool descriptions - #179
Merged
Merged
Conversation
…cts in tool descriptions; enforce documented batch_patch early-stop
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
odek | 2ed1ca8 | Commit Preview URL Branch Preview URL |
Sep 03 2026, 07:43 AM |
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
Second adversarial pass on native tool descriptions, targeting the principal's two observed failure modes in real agent runs: models missing behavior-changing parameters (getting default/mush output, then falling back to shell) and models switching to shell for jobs the zero-fork tools do better. Three sequential reviewers (parameter neglect / shell-reflex interception / output-contract clarity; 5-6 code-verified findings each) + a fourth verifier on the final diff: APPROVE, 0 code defects (2 text nits fixed).
Highlights (17 findings across 6 files)
Parameter guidance (silent-truncation theme)
head_tail: default 10 / max 100 now stated in the description — "a peek, not the file"; compare tototal_lines.tree: deeper entries are silently cut at max_depth (3/10) — pass 10 before concluding absence.search_files/multi_grep/glob: limit params now disclose the default, the cap, and that the walk stops silently (50/500, 50/pattern, 50/1000) — raise before trusting completeness.bg_start.timeout_seconds: set it for anything that can loop/poll/listen forever; 0/absent = runs until session end, never notifies.delegate_tasks.trust_level: the omission default is now stated accurately — omitted = untrusted (the safe choice); trusted only for fully internal content.Shell-reflex interception — descriptions now name the exact reflexes they replace:
read_file(cat / sed -n / head),multi_grep(grep -rn / rg),glob(find),count_lines/word_count(wc),diff(diff/cmp),file_info(stat/du/ls -l). Family note added where it wins hardest:json_query/base64/checksumwork inside the sandbox where jq/xxd/sha256sum may not even exist.Output contracts (description-vs-code drift)
trandsort: descriptions now state the hard truth — the source file is NEVER modified; results come back in the response (persist with write_file/patch). Previously "operates on a file" implied in-place mutation.glob: output envelope documented as {"matches":[…]} with empty ={"matches":null}— zero matches is not an error.browser: runtime error strings no longer reference phantombrowser_navigate/browser_snapshottools (follow-up from fix: polish native tool descriptions for discoverability and turn efficiency #178) — they now point at the real action contract.One code fix: batch_patch early-stop enforced
The tool description (since before v1.41.1) promised "at the first failing edit the remaining edits are skipped (early-stop)" — the code actually continued past failures, and one test pinned the undocumented side. Docs-as-contract: the loop now enforces early-stop (later edits report
skipped: an earlier patch failed (early-stop), never touch disk; earlier-applied edits are kept). RED-first: newTestBatchPatchEarlyStopOnFirstFailurefailed against the old loop;TestBatchPatch_ContinueOnErrorrewritten asTestBatchPatch_EarlyStopto pin the documented contract.Verification
go build,go vet, fullcmd/odek+internal/memorysuites green (-count=1).