🤖 refactor: derive tool dispatch tables from the TOOL_DEFINITIONS catalog - #4003
Merged
Conversation
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
This comment has been minimized.
This comment has been minimized.
_Generated with `xum` • Model: `openai:gpt-5.6-sol` • Thinking: `high`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=high -->
Review follow-up: the four per-command handlers are only reachable through processSlashCommand now, and /plan open lost its dedicated tests in the result-based rewrite. _Generated with `xum` • Model: `anthropic:claude-fable-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-fable-5 thinking=xhigh -->
Codex P1: getDraft captured at command invocation reports that render's input, so async commands cleared newer drafts on consume and never fired restore-if-empty. _Generated with `xum` • Model: `anthropic:claude-fable-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-fable-5 thinking=xhigh -->
Codex P2: text equality cannot distinguish a retyped identical draft from the original invocation. Commands already clear through their own clear-input actions (matching trunk), so the terminal clear was additive and could only destroy mid-phase drafts. _Generated with `xum` • Model: `anthropic:claude-fable-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-fable-5 thinking=xhigh -->
Codex P2 follow-up: with the terminal consume-path clear gone, /dream and /refine left the executed command re-runnable in the composer. Emit clear-input from the handlers so commands own their composer effects. _Generated with `xum` • Model: `anthropic:claude-fable-5` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-fable-5 thinking=xhigh -->
…itative in background wrappers
…te; drop dead code
ibetitsmike
force-pushed
the
mike/deep-tool-modules
branch
from
August 28, 2026 19:22
64e9d27 to
ef30fa2
Compare
github-merge-queue
Bot
removed this pull request from the merge queue because a pull request earlier in the stack was removed
Aug 29, 2026
github-merge-queue
Bot
removed this pull request from the merge queue because a pull request earlier in the stack was removed
Aug 29, 2026
github-merge-queue
Bot
removed this pull request from the merge queue because a pull request earlier in the stack was removed
Aug 29, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 29, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to invalid changes in the merge commit
Aug 29, 2026
ibetitsmike
enabled auto-merge
August 29, 2026 03:33
auto-merge was automatically disabled
August 29, 2026 04:21
Pull request was closed
ibetitsmike
enabled auto-merge
August 29, 2026 04:22
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 29, 2026
mux-bot Bot
added a commit
that referenced
this pull request
Aug 29, 2026
#4003 (derive tool dispatch tables from the TOOL_DEFINITIONS catalog) replaced the RESULT_SCHEMAS lookup in ptc/typeGenerator.ts with the getToolResultSchema() helper, removing the only consumer of the BridgeableToolName type. The same commit also rewrote the tools.ts comment that pointed readers at it, so nothing references the type anymore. Type-only and erased at compile time, so this is behavior-preserving.
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
Makes
TOOL_DEFINITIONSthe single self-describing per-tool catalog (input schema + result schema + PTC bridging metadata) and rebuilds the parallel per-tier dispatch tables as derived views of it. Five hand-maintained tables are deleted outright, the browser registry loses its duplicated schema column, and the branch is a net simplification: 1321 insertions, 1586 deletions, net -265 lines (production and tests, vs merge base).Background
The tool seam was fragmented into parallel string-keyed switchboards that restate what
TOOL_DEFINITIONSalready knows: the browserTOOL_REGISTRYduplicated every tool's zod schema, the CLI kept three separate name-keyed maps,toolDefinitions.tskept a hand-writtenBridgeableToolNameunion next to a parallelRESULT_SCHEMAStable, and the PTC bridge kept its ownEXCLUDED_TOOLSliteral. Each table could silently drift from the spine, and one tool change was a shotgun edit across tiers. This PR deepens the existing catalog seam per-switchboard rather than introducing per-tool scaffolding.Implementation
Deleted (derived from the catalog instead):
RESULT_SCHEMAStable: each definition entry now carries itsresultSchemadirectly.BridgeableToolNameunion: now a mapped type derived from which entries declareresultSchema.EXCLUDED_TOOLSliteral in the PTC bridge: entries declareptcExcludedwith their why-reason; the bridge derives the set (one inline special case for the dynamicstatus_set, which has no definition entry).startFormatters+endFormattersmaps and theMULTILINE_RESULT_TOOLSset: merged into one binding table.TOOL_REGISTRY's schema column: lookup derives the render schema fromTOOL_DEFINITIONSby name; entries collapse to bare component bindings.Surviving additions, each justified:
getToolComponent.ts: only genuine divergences from the definition schema (legacy history-only names such astask_terminate,agent_report's legacy file-backed args union, dynamicstatus_set, andtask_workspace_lifecycle's historical args so old transcripts keep their proper card).TOOL_NAME_TO_ICONdeliberately stays inToolPrimitives.tsx: generic chrome needs a name-keyed icon lookup from a leaf module that every tool card imports, so folding it into the component catalog would create a browser module cycle. It is already the irreducible one-line-per-tool form.Diff-shape note:
toolDefinitions.tsshows large +/- churn because the result-schema consts had to move aboveTOOL_DEFINITIONS(const ordering); the file is net -18 lines and the schemas themselves are unchanged.Out of scope (parallel architecture PRs touch adjacent seams): assembly in
tools.ts/toolAssembly.ts, per-tool execution factories, view components and stories.Validation
code_execution.agent_reportrouting, schema-mismatch fallback) plus a new red-green regression test for historicaltask_workspace_lifecyclerendering.WorkspaceFooterBarfailures pass in isolation on both main and this branch, a known full-suite interference flake).Risks
Low. Behavior-preserving derivations with identical inputs and outputs; the riskiest surface is transcript rendering of historical tool calls, which is covered by the restored override map and its regression test. PTC sandbox type generation is guarded by the unchanged
typeGeneratortest suite.Generated with
xum• Model:anthropic:claude-fable-5• Thinking:xhigh