Skip to content

chore: remove abandoned ui_graph frontend tool - #5114

Open
claude[bot] wants to merge 1 commit into
mainfrom
chore/remove-ui-graph-tool
Open

chore: remove abandoned ui_graph frontend tool#5114
claude[bot] wants to merge 1 commit into
mainfrom
chore/remove-ui-graph-tool

Conversation

@claude

@claude claude Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Which feature, and why this one

The supplied internal-only-gates.log had 17 lines, and 16 of them are out of scope by the task's own skip-list: HMR context preservation (NodeContext, TimelineInstance, SketchInstance), tRPC loggerLink dev logging, dev-only protocol validation (validateInboundMessage, web + mobile), a Sentry environment label, a __DEV__ type declaration, and a SECRETS_MASTER_KEY assertion 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 by hidden: true.

Evidence

Question Command Answer
When last touched? git log -L58,58:web/src/lib/tools/builtin/graph.ts Gate set 2026-02-14 (#1646 "Nodetool Agent Panel"); tool added 2025-12-14. Since then the file saw only mechanical lint sweeps (no-runtime-typeof, require-safety-comment). ~6 months.
Who references it? grep -rn "ui_graph" --include="*.ts*" --include="*.md" . 5 hits: its own registration, a comment in toolSchemas.ts noting it is excluded, and 3 lines in a repo-local Claude skill doc. No code caller.
Documented? grep -rn "ui_graph" docs/ AGENTS.md README.md packages/*/AGENTS.md NONE in docs
Tested? grep -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.
Does a working path exist? see below No.

Why nothing can reach it

Two independent exclusions:

  1. FrontendToolRegistry.getManifest() ran .filter((tool) => !tool.hidden) — the LLM-facing manifest never contained it.
  2. uiToolSchemas in @nodetool-ai/protocol drives 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 listed ui_graph:
$ node -e "import('@nodetool-ai/protocol').then(m => …)"
uiToolSchemas (drives MCP registration + agent capability specs):
  count = 15
  ui_graph present?  false
  ui_add_node, ui_connect_nodes, ui_copy, ui_delete_edge, ui_delete_node,
  ui_get_graph, ui_move_node, ui_open_workflow, ui_paste, ui_run_workflow,
  ui_search_models, ui_search_nodes, ui_set_node_title, ui_switch_tab,
  ui_update_node_data

The hidden flag'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_nodes behind a normalization layer accepting array-or-record for both nodes and edges, 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 in builtin/index.ts.
  • The gate itself: hidden?: boolean on FrontendToolDefinition and the .filter() in getManifest(). ui_graph was its only user, so no gate is left behind.
  • The two tests covering that gate (there were duplicates in web/src/__tests__/ and web/src/lib/tools/__tests__/).
  • optionalWorkflowIdSchemaCompact in builtin/workflow.ts and the now-unused zod import — the constant existed solely for this tool.
  • The stale comment in 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 typecheck   → exit 0 (web, electron, mobile)
npm run lint        → exit 0, no errors, no new warnings
npm run test        → web 1154 suites / 13310 tests
                      electron 63 / 682
                      mobile 75 / 1039        all passing
npm run test --workspace=packages/protocol
                    → 49 files / 904 tests passing
                      (includes the assertion pinning uiToolSchemas at 15)

npm run build:packages was needed first — a fresh tree gave module-resolution errors in browserRunnerCore.ts unrelated to this change.

Follow-up not included here

.claude/skills/nodetool-workflow-builder/SKILL.md has 3 stale ui_graph references (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

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

0 participants