Skip to content

fix(tools): read default-shaped arguments as absent (T15) - #267

Merged
lg2m merged 4 commits into
docs/eng-1012-tool-failure-auditfrom
fix/eng-1012-t15-tolerant-defaults
Oct 8, 2026
Merged

lg2m merged 4 commits into
docs/eng-1012-tool-failure-auditfrom
fix/eng-1012-t15-tolerant-defaults

Conversation

@lg2m

@lg2m lg2m commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #265 (base docs/eng-1012-tool-failure-audit). Implements T15 from docs/plans/tool-layer.md § D9.

Closes ENG-1013 · part of ENG-1012

User-visible behavior

Models that fill in every optional argument no longer fail calls whose intent has exactly one reading. In the audit, these classes were 378 of 753 read-side errors since 2026-09-26, and each one showed as a red ✕ in the TUI:

Tool Before After
read_file ranges + offset/limit → invalid_ranges (252) ranges wins; header note=offset_ignored
read_file "370,470" → invalid_ranges read as 370-470
edit_file "old":"" beside a real insert_after → invalid_edit (63) empty unused forms are absent; an empty only form still fails with the old message
tree / search "glob":"", include:[""] → bad_glob (16) no filter
read_tool_result "query":"" → invalid_query (11) pages by offset/limit
search context: 10 → invalid_context (36) clamps to 5; header note=context_clamped=5

Unchanged: which file is written, which command runs, which approval applies; path_not_found and range_out_of_bounds stay errors.

Design notes

  • Each rule is a match/filter in the tool's own validation; no new layer.
  • Tool schemas are untouched, so schema bytes and the declaration hash fixture hold. The tolerance is validation-side only.
  • The search.context clamp was RR10's (ENG-872) rule. RR10 has not landed, so it lands here, and RR10 keeps type coercion (stringified arrays, unknown fields).

Verification

  • cargo fmt --all, cargo clippy -p qq-core --all-targets --all-features -- -D warnings
  • cargo test -p qq-core: 858 lib tests plus integration tests green, including new regressions for every class above
  • tool_dispatch smoke test green; the required benchmark was subsequently recorded (see review receipt below).

Compatibility / performance

No protocol or schema change. Valid calls produce byte-identical results; the only new output is the note= header field on calls that previously failed.

Next in the stack: T16 (Responses *.done arguments, after a captured stream) and T17 (ToolErrorKind severity in the TUI).

Review repairs (2026-10-07, 50b07da)

  • Normalize empty unused edit forms in server-owned approval previews; regression failed before fix and passes afterwards.
  • Attach note=offset_ignored to unchanged/info/outline/image successful reads too.
  • Workspace fmt, all-target/all-feature Clippy, tests (full rerun), and build passed. Initial run hit two existing headless budget timeouts; isolated and full reruns passed. Independent read-only approval-path review: Approve, no blockers.
  • Required tool_dispatch measurement now recorded: 30 alternating release A/B pairs against docs(tools): record tool-failure audit and plan T15–T17 #265 f7ecfb8, median 74,890 → 66,261 ns. I/O pressure 37–38%; no speedup/tail claim. This supersedes the original benchmark omission. Raw samples remain untracked; ledger contains receipt.

Models that fill every optional field failed read_file, edit_file, tree,
search and read_tool_result calls whose intent had exactly one reading
(tool-layer D9: 378 of 753 read-side errors since 2026-09-26).

- read_file: ranges wins over offset/limit with note=offset_ignored;
  a comma inside one range reads as '-'
- edit_file: empty old/insert_before/insert_after are absent; an empty
  only-form still fails
- tree glob and search include/exclude: "" means no filter
- read_tool_result: an empty query pages
- search: context above 5 clamps with note=context_clamped=5

Refs ENG-1012
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T08:10:48.570316Z 76bdcc6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lg2m
lg2m added this pull request to stack #268 October 7, 2026 04:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00a6abd29f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/plans/progress/tool-layer.md Resolved
Comment thread crates/qq-core/src/tools/read.rs Resolved
Comment thread crates/qq-core/src/tools/edit.rs Resolved
T15 / ENG-1013. Regressions: edit_preview_normalizes_empty_unused_forms and read_file_reports_ignored_offsets_in_every_successful_mode failed before the repairs. Record workspace verification and dispatch measurements.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50b07da8d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/tools/search.rs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4688477f13

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-core/src/tools/read.rs Resolved
@lg2m
lg2m merged commit 409dd75 into main Oct 8, 2026
4 checks passed
@lg2m
lg2m deleted the fix/eng-1012-t15-tolerant-defaults branch October 8, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant