You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(tools): read tool metadata instead of the registry on client paths
Cuts the last four edges that pulled `@/tools/registry` into the workspace
shell. Every workspace route drops ~4,700 modules:
route before after
/w (canvas) 6,592 1,908 -71%
/logs 6,227 1,543 -75%
/tables 5,903 1,217 -79%
/files 5,996 1,310 -78%
workspace layout 5,751 1,063 -82%
Dev cold compile of the canvas, n=3, cache cleared between runs:
before 32.3s / 31.4s / 30.1s RSS 9.0-12.5 GB
after 22.4s / 22.2s / 21.6s RSS 7.8-9.2 GB
That lands where the `dev:minimal` escape hatch measured (20.0s / 6.7 GB)
without its downside — `dev:minimal` swaps in curated registries that drop ~250
services, whereas this keeps every tool working.
Rewired:
- `block-outputs` -> `getToolOutputsMetadata` (needed `outputs`)
- `serializer` -> `getToolParams` (needed `params`)
- `validation` -> `hasToolId` (needed existence only)
- `tools/params` -> `getToolMetadata` (needed `params`, `oauth`, `name`)
`tools/params.ts` was the stubborn one: `mcp-dynamic-args.tsx` imports only
`formatParameterLabel` from it, so the whole registry rode in behind a string
helper — the same shape as the `mergeToolParameters` edge cut earlier.
Adds a third generated artifact, `tool-ids.ts` (~110 KB). Resolution needs only
the key set, so `@/tools/metadata` and `@/tools/metadata-outputs` both resolve
through it and stay independent of each other, and an existence check costs
~110 KB instead of ~4 MB.
Behaviour preservation was the risk here: `getTool` resolves an unversioned name
onto its newest version, and a plain key lookup would have silently reported 246
versioned tools as missing. `resolveToolId` is reproduced against the id set and
differentially tested — 4,404 probes (every id, every stripped base name, and an
unknown) comparing old vs new resolution and existence: 0 mismatches.
`ToolWithParameters.toolConfig` and `SubBlocksForToolInput.toolConfig` narrow
from `ToolConfig` to `ToolMetadata`. The only external reader is
`tool-input.tsx`, which uses `.name`.
0 commit comments