Skip to content

refactor: consolidate built-in tool registration and dispatch - #247

Merged
Qiyuanqiii merged 1 commit into
mainfrom
codex/consolidate-tool-registry
Oct 5, 2026
Merged

Qiyuanqiii merged 1 commit into
mainfrom
codex/consolidate-tool-registry

Conversation

@Qiyuanqiii

Copy link
Copy Markdown
Member

Summary

Built-in tool definitions, valid names, action classes, project-config IDs, payload normalization, and Gateway dispatch were maintained in separate lists. This allowed advertised GitHub review evidence tools to miss dispatch and code-intel calls with valid authority to be rejected by the Store.

Create one ordered registry in internal/toolgateway/registry.go and derive those lookups and dispatch paths from its entries. The Agent's static admission check now uses the same registry. Remove the old lists, dispatch switch, and unused tool-name helpers: production Go code is reduced by 87 lines.

  • Include the existing code-intel tools and browser scroll/key tools in CLI schema listing and lookup.
  • Route both GitHub review evidence tools through their existing Agent Code executor.
  • Persist code-intel calls through the existing Agent Code authority decoder, retaining Run binding and canonical serialization.
  • Preserve model advertisement order, phase selection, dynamic capability schemas, policy/budget checks, ScriptProcess's separate execution path, and historical ledger compatibility.

This PR is based on #246 (codex/clarify-runtime-names) so its diff contains only this 16-file registry change. Merge the naming PR first, then retarget this PR to main.

Validation

  • GOTOOLCHAIN=go1.26.6 go test ./internal/toolgateway -count=1 — full package passes.
  • Go 1.26.6: all packages compile and 19 selected app/application/store tests pass, covering tool admission, dynamic capabilities, CLI schema queries, policy denial, restart recovery, ledger compatibility, and code-intel authority persistence.
  • New regressions exercise GitHub evidence dispatch through the existing gateway, successful code-intel storage/readback, and rejection of missing or cross-Run authority.
  • git diff --check passes.

Surface governance

  • No Surface is added, promoted, downgraded, deprecated, or removed.

  • Registry item(s): N/A — no Surface change

  • Target tier / transition: N/A — no Surface change

  • Entry criteria / decision: N/A — no Surface change

  • Owner: N/A — no Surface change

  • Shared Go Application contract: N/A — no Surface change

  • Authority impact: N/A — no Surface change

  • Supported platforms: N/A — no Surface change

  • Release / test evidence: N/A — no Surface change

  • Compatibility strategy: N/A — no Surface change

  • Deprecation window: N/A — no Surface change

  • Removal / rollback plan: N/A — no Surface change

Audit

  • No credentials or local runtime data are included.
  • Policy, workspace, sandbox, and persistence boundaries were reviewed; existing runtime authority checks remain in place.
  • Current architecture documentation describes the registry and runtime capability boundary.

Co-authored-by: Codex codex@openai.com

Derive tool names, classes, configuration eligibility, schemas, normalization and gateway dispatch from one ordered registry. Include dynamic-capability tools in static schema lookup, route GitHub review evidence tools through the existing executor, and persist code-intel authority through the shared workspace authority path.

Co-authored-by: Codex <codex@openai.com>
Base automatically changed from codex/clarify-runtime-names to main October 5, 2026 01:51
@Qiyuanqiii
Qiyuanqiii merged commit 477ae37 into main Oct 5, 2026
19 checks passed
@Qiyuanqiii
Qiyuanqiii deleted the codex/consolidate-tool-registry branch October 5, 2026 01:52
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