chore: remove abandoned ui_graph frontend tool - #5114
Open
claude[bot] wants to merge 1 commit into
Open
Conversation
ui_graph registered a bulk "add nodes + edges" frontend tool, then hid itself from the LLM manifest with `hidden: true`. Nothing could reach it: `getManifest()` filtered it out, and `uiToolSchemas` — which drives MCP registration and the agent capability specs — never listed it. The flag's own comment claimed it kept "direct calls by name for backwards compatibility", but no caller in the repo emits the name. Its 266 lines duplicated ui_add_node and ui_connect_nodes behind a normalization layer that accepted array-or-record for both nodes and edges — a shape no caller produced. Every sibling graph tool has a test file; this one had none, and no doc outside its own source. Removes the tool, its `hidden` gate (its only user), the registry filter and type field the gate needed, the two tests covering the gate, and `optionalWorkflowIdSchemaCompact`, which existed solely for this tool. The LLM-facing manifest is unchanged: a tool it never saw is now also not registered. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Which feature, and why this one
The supplied
internal-only-gates.loghad 17 lines, and 16 of them are out of scope by the task's own skip-list: HMR context preservation (NodeContext,TimelineInstance,SketchInstance), tRPCloggerLinkdev logging, dev-only protocol validation (validateInboundMessage, web + mobile), a Sentry environment label, a__DEV__type declaration, and aSECRETS_MASTER_KEYassertion in the E2E test server. Those guard correctness or are dev plumbing, not features.So I widened the scan for real internal-only feature gates and found
ui_graph: a registered frontend agent tool permanently hidden from every consumer byhidden: true.Evidence
git log -L58,58:web/src/lib/tools/builtin/graph.tsno-runtime-typeof,require-safety-comment). ~6 months.grep -rn "ui_graph" --include="*.ts*" --include="*.md" .toolSchemas.tsnoting it is excluded, and 3 lines in a repo-local Claude skill doc. No code caller.grep -rn "ui_graph" docs/ AGENTS.md README.md packages/*/AGENTS.mdNONE in docsgrep -rn "ui_graph" web/src --include="*.test.ts*"NONE. Every sibling graph tool has a test file (addNodeTool.test.ts,connectNodesTool.test.ts,getGraphTool.test.ts, …); this one has none.Why nothing can reach it
Two independent exclusions:
FrontendToolRegistry.getManifest()ran.filter((tool) => !tool.hidden)— the LLM-facing manifest never contained it.uiToolSchemasin@nodetool-ai/protocoldrives both MCP registration (packages/websocket/src/mcp-agent-tools.ts:535) and the agent capability specs (packages/agents/src/capabilities/ui.specs.ts). It lists 15 tools and never listedui_graph:The
hiddenflag's comment claimed it preserved "direct calls by name for backwards compatibility". No caller in the repo emits that name, and a model that never sees a tool does not invent it. The MCP surface would reject it as unknown.Verdict: delete
Abandoned on every criterion — no behavioral commits for six months, no references outside its own file, no docs, no tests, no reachable path. Its 266 lines duplicated
ui_add_node+ui_connect_nodesbehind a normalization layer accepting array-or-record for bothnodesandedges, a shape no caller produced.I did not ship it: hiding it was a deliberate token-saving decision taken when the Agent Panel landed, and finer-grained replacements already cover the job.
What was removed
web/src/lib/tools/builtin/graph.ts(266 lines) and its side-effect import inbuiltin/index.ts.hidden?: booleanonFrontendToolDefinitionand the.filter()ingetManifest().ui_graphwas its only user, so no gate is left behind.web/src/__tests__/andweb/src/lib/tools/__tests__/).optionalWorkflowIdSchemaCompactinbuiltin/workflow.tsand the now-unusedzodimport — the constant existed solely for this tool.packages/protocol/src/toolSchemas.ts.The LLM-facing manifest is unchanged. A tool no consumer ever saw is now also not registered.
7 files, +4 / −311.
Verification
npm run build:packageswas needed first — a fresh tree gave module-resolution errors inbrowserRunnerCore.tsunrelated to this change.Follow-up not included here
.claude/skills/nodetool-workflow-builder/SKILL.mdhas 3 staleui_graphreferences (including one asserting it is "hidden tool, but callable", which was already wrong for the MCP surface). Editing that file was declined by a permission prompt in this session, so it is left for a follow-up rather than worked around.🤖 Generated with Claude Code