Skip to content

fix(plugins): improve tool schemas to reduce model parse failures - #222

Merged
w0wl0lxd merged 14 commits into
mainfrom
fix/log-audit-tool-prompts
Aug 4, 2026
Merged

w0wl0lxd merged 14 commits into
mainfrom
fix/log-audit-tool-prompts

Conversation

@w0wl0lxd

@w0wl0lxd w0wl0lxd commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Improves the built-in tool schemas and descriptions to reduce two recurring model-side log patterns:

  • tool input parse failed (e.g., missing new_string, wrong batch envelope)
  • unbounded command execution (missing justification)

Changes

  • bash: stronger justification requirement wording.
  • batch: accept tool_uses as an alias for tool_calls; clarify the array item shape.
  • edit/multiedit: add old_string/new_string field descriptions and top-level path requirement.
  • grep: top-level pattern requirement and parameter descriptions.
  • read: top-level path requirement.
  • todo_write: explicit status enum description.
  • Regenerated n00n-token-profile/baselines/cold_start.json for the intentional schema/prompt growth.

Test plan

  • cargo clippy --all --tests -- -D warnings clean
  • cargo nextest run --workspace passes (4422 passed, 1 skipped)
  • stylua clean

Note

Low Risk
Mostly schema metadata and batch restore/header input normalization; behavior changes are limited to accepting tool_uses on batch UI restore and clearer model-facing contracts.

Overview
Tightens built-in tool JSON schemas and copy so models hit fewer parse/validation errors (missing new_string, wrong batch envelope, unbounded bash without justification).

batch: Documents tool_calls more explicitly, adds schema alias tool_uses, and uses a shared tool_calls_of helper in header/restore so persisted history that still says tool_uses renders like live parse. New restore_accepts_tool_uses_alias test in batch_policy.rs.

Other plugins: Clearer field descriptions and top-level required where it helps (read/grep/edit/multiedit/todo_write); bash states that broad commands fail without justification.

Docs: site/docs/content/tools/_index.md aligned with the schema text; changelog entry 222.fixed.md.

Reviewed by Cursor Bugbot for commit ca3705d. Bugbot is set up for automated code reviews on this repo. Configure here.

- bash: stronger `justification` wording in description and schema.
- batch: accept `tool_uses` as an alias for `tool_calls` and clarify the
  array item shape, fixing the common provider envelope mismatch.
- edit/multiedit: add `old_string`/`new_string` descriptions to the
  schema; make `path` required at the object level.
- grep: mark `pattern` required at the object level and add parameter
  descriptions.
- read: mark `path` required at the object level.
- todo_write: add an explicit `status` enum description.
- Regenerate `n00n-token-profile/baselines/cold_start.json` to account
  for the intentional schema/prompt growth.
@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@w0wl0lxd, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4bd90bc4-e158-48d3-8387-8bae373b55f0

📥 Commits

Reviewing files that changed from the base of the PR and between 84c2c28 and 5c34bc2.

📒 Files selected for processing (9)
  • changelog.d/222.fixed.md
  • n00n-lua/tests/batch_policy.rs
  • plugins/bash/init.lua
  • plugins/batch/init.lua
  • plugins/edit/init.lua
  • plugins/grep/init.lua
  • plugins/read/init.lua
  • plugins/todo_write/init.lua
  • site/docs/content/tools/_index.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_ea5539fa-191b-4273-bf20-33d9fec24763)

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Add the missing changelog.d fragment for this PR.
@cursor

cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_2beda632-0ace-4a10-8dea-cbcf8875cf8e)

@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@w0wl0lxd
w0wl0lxd marked this pull request as ready for review August 2, 2026 02:30
@cursor

cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_7c16dfb4-42ae-4ce3-8b0b-5fb3c21e8a06)

@w0wl0lxd

w0wl0lxd commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: 6d9285d4d7

ℹ️ 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 plugins/batch/init.lua
@w0wl0lxd

w0wl0lxd commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Batch restore ignores tool_uses alias
    • restore and header now read tool_calls or the tool_uses alias from persisted raw input, so reopen rebuilds children and the tool-count header.

You can send follow-ups to the cloud agent here.

Comment thread plugins/batch/init.lua
Schema validation remaps tool_uses to tool_calls before the handler
runs, but restore and header receive persisted raw model JSON. Read
either key so reopen rebuilds children and the tool count header.
@w0wl0lxd

w0wl0lxd commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@w0wl0lxd

w0wl0lxd commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 787688c. Configure here.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 787688c93b

ℹ️ 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".

@w0wl0lxd
w0wl0lxd enabled auto-merge August 3, 2026 02:47
@w0wl0lxd
w0wl0lxd force-pushed the fix/log-audit-tool-prompts branch from 41593d1 to f8ad769 Compare August 3, 2026 03:20
@w0wl0lxd

w0wl0lxd commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@w0wl0lxd

w0wl0lxd commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_58438a82-fb62-40fa-9d26-ddf36f9d8508)

@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: f8ad769e7a

ℹ️ 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 plugins/edit/init.lua

@github-actions github-actions 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.

Criterion

Details
Benchmark suite Current: 5c34bc2 Previous: 84c2c28 Ratio
fib/jit_mlua_hook 6831839 ns/iter (± 276715) 8426589 ns/iter (± 110410) 0.81
fib/jit_watchdog 2246489 ns/iter (± 40437) 1717091 ns/iter (± 25793) 1.31
fib/jit_none 2251775 ns/iter (± 63327) 1717158 ns/iter (± 12889) 1.31
fib/interp_mlua_hook 8263465 ns/iter (± 180341) 9475873 ns/iter (± 25319) 0.87
fib/interp_watchdog 4350687 ns/iter (± 26262) 3377220 ns/iter (± 11487) 1.29
fib/interp_none 4338113 ns/iter (± 83661) 3350648 ns/iter (± 36411) 1.29
buffer_rw/jit_mlua_hook 586214 ns/iter (± 5133) 856795 ns/iter (± 2515) 0.68
buffer_rw/jit_watchdog 192493 ns/iter (± 644) 104862 ns/iter (± 23251) 1.84
buffer_rw/jit_none 192958 ns/iter (± 2398) 104660 ns/iter (± 7010) 1.84
buffer_rw/interp_mlua_hook 1070279 ns/iter (± 25623) 1260740 ns/iter (± 3130) 0.85
buffer_rw/interp_watchdog 619919 ns/iter (± 9727) 532122 ns/iter (± 990) 1.16
buffer_rw/interp_none 605292 ns/iter (± 10616) 531006 ns/iter (± 1202) 1.14
splash_render_120x40 81290 ns/iter (± 1511) 65764 ns/iter (± 200) 1.24
splash_render_200x60 163506 ns/iter (± 21051) 100937 ns/iter (± 6740) 1.62

This comment was automatically generated by workflow using github-action-benchmark.

@w0wl0lxd

w0wl0lxd commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@w0wl0lxd

w0wl0lxd commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_22d673d4-a631-4939-8d8b-62141d9052c1)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 5b71b8d25a

ℹ️ 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".

@w0wl0lxd

w0wl0lxd commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@cursor review verbose=true

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

Bugbot request id: serverGenReqId_da1b3241-6114-41e8-b892-7d0c37f975ef

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

Bugbot rules debug

No rules were used for this review.

https://cursor.com/docs/bugbot#team-rules

Bugbot request id: serverGenReqId_da1b3241-6114-41e8-b892-7d0c37f975ef

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_da1b3241-6114-41e8-b892-7d0c37f975ef)

- Replace the confounded positive-only test with two targeted cases: restore with state and restore from LLM output with no state.

- Add a negative test for malformed tool_uses input that should fall back to a plain view.

- Assert exact child header text so alias parsing is verified independently of pre-seeded state.

@greptile-apps greptile-apps 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.

w0wl0lxd has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps 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.

w0wl0lxd has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps 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.

w0wl0lxd has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@w0wl0lxd
w0wl0lxd merged commit 470f64e into main Aug 4, 2026
30 checks passed
@linear-code

linear-code Bot commented Aug 4, 2026

Copy link
Copy Markdown

N00N-175

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.

2 participants