Skip to content

refactor(tools): define tool bindings in task templates - #1898

Merged
lizhengfeng101 merged 1 commit into
mainfrom
refactor/task-tool-selection
Nov 11, 2026
Merged

lizhengfeng101 merged 1 commit into
mainfrom
refactor/task-tool-selection

Conversation

@lizhengfeng101

Copy link
Copy Markdown
Contributor

Description

Move built-in tool selection out of the shared tool catalog and into the task templates that own each model request.

  • Add ordered MAIN_TASK.tools lists for review and scan. Scan continues to omit file_read_diff.
  • Add PLAN_TASK.tool_references for review planning. These definitions are rendered as prompt text only; planning remains a single request without callable tools.
  • Include file_read in planning references, matching the existing planning prompt example. This is an intentional prompt change, not a claim of complete behavioral equivalence.
  • Remove plan_task / main_task catalog flags and the hard-coded scan exclusion. Resolve names in first-occurrence order, deduplicate references, preserve raw schemas, and reject unknown references or invalid catalog definitions. Empty selections stay empty.
  • Reject bindings on helper tasks that do not consume them. Keep execution registries, MCP discovery, and task-specific completion/filter protocols unchanged; these lists are not an execution sandbox or a runtime customization API.
  • Add regression coverage and synchronize architecture, tools, and contributor documentation in all five languages.

The six tool definitions and default main-task tool ordering are unchanged. No CLI flags or runtime tool overrides are added.

Type of Change

  • Bug fix (complete planning tool descriptions)
  • Refactoring
  • Documentation update
  • Breaking change

How Has This Been Tested?

  • make check
  • Targeted make test for the template, tool catalog, agent, CLI, and review-task packages
  • Full make test with race detection
  • make coverage: 91.5%, above the 90% threshold
  • make build
  • node scripts/github-actions/check-plugin-contract.test.js
  • node scripts/github-actions/check-plugin-contract.js all: all links resolve; the existing Cursor path-resolution assumption warning remains
  • npm --prefix pages test: 53 tests passed
  • npm --prefix pages run build: passed with bundle-size warnings
  • ocr review --audience agent --format json --background "...": all 9 selected production files completed, 0 comments, no failed or waived files. Test files and Markdown were not selected by OCR.

Regression tests cover ordered/deduplicated selection, empty lists, invalid definitions and references, unsupported task bindings, actual review/scan request tools, and planning descriptions without callable tools. Existing execution-equivalence fixtures remain unchanged.

Local verification used the installed Go toolchain with the stale GOROOT unset and Node 24 for Pages. Temporary executables stayed under the Git-ignored dist/verify/tmp directory. No external model-quality benchmark was run for the additional planning reference.

Checklist

  • My code follows the project's coding style
  • I have performed a human self-review of the changes
  • Relevant regression tests are included and pass
  • Documentation is updated
  • I have signed the CLA
  • I have reviewed the disclosed AI output and will answer maintainer questions and review comments from my own understanding

AI/LLM Disclosure

Codex using gpt-6-astra assisted with implementation, tests, documentation, and PR preparation. Open Code Review (ocr v1.13.7), also using gpt-6-astra, performed the automated production-code review. No AI attribution or co-author trailers are included in the commit. Human self-review, the CLA, and the author's responsibility for answering maintainer questions remain for the author to confirm.

Related Issues

Follow-up to #1894.

@github-actions

Copy link
Copy Markdown
Contributor

✅ OpenCodeReview: Review complete: 0 finding(s) across 9 selected item(s).

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

Reviewed the complete 32-file diff, the new resolver/validation paths, the command request fixtures, and the existing discussion. The tool-bindings search returned only this PR. #1894 is already merged and removed runtime overrides; moving versioned membership into the owning task templates is a distinct follow-up, not a duplicate of that removal.

The review main-task list preserves the previous six-tool order, the scan list preserves the previous exclusion of file_read_diff, and MCP definitions are still appended through the existing review path. Resolve preserves raw schemas, rejects invalid catalog/name pairs and unknown references, and deduplicates selections in first-occurrence order without turning an empty selection into the full catalog. Helper-task bindings are rejected by template validation. The tests cover these boundaries and inspect the actual review/scan request tools; the planning fixture separately verifies one request with no callable tools.

Adding file_read to planning reference text is an intentional prompt change, accurately disclosed and reflected across the five documentation locales. It does not grant planning tool execution, and the docs correctly avoid treating these definition lists as an execution sandbox. I found no blocking defect in this patch.

Validation: source and regression-test inspection only. I did not independently run the repository/race/Pages suites or a model-quality benchmark, and do not treat the contributor's reported results as my own test execution.

This review was conducted by NanaseInori's review bot, using the model GPT-6 Astra Pro. If you need a human review, please manually @NanaseInori.

@css521 css521 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@MuoDoo MuoDoo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice refactor

@lizhengfeng101
lizhengfeng101 merged commit 5e9a18e into main Nov 11, 2026
16 checks passed
@lizhengfeng101
lizhengfeng101 deleted the refactor/task-tool-selection branch November 11, 2026 02:12
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.

4 participants