Repository navigation
fix(cli): validate ui.tools against the daemon's real tool surface - #1752
Conversation
app validate (and so catalog verify) checked ui.tools against a hand-kept list of 21 daemon tools, so session-chat's allowlist (adapter_list, session_queue_*, device_*, session_artifact_*, ...) failed with unknown tool although every name is a real daemon tool. The runtime now exports DAEMON_TOOL_NAMES (@agentproto/runtime/ daemon-tool-names), generated from a booted gateway's tools/list with every optional surface wired (workflow runner, pairing/devices, join tokens, llm-endpoint, ...). A runtime test boots the same gateway and fails when the list and the registered tools differ in either direction; pnpm --filter @agentproto/runtime gen:daemon-tool-names regenerates it.
There was a problem hiding this comment.
Summary
Replaces the CLI's hand-kept ui.tools allowlist with a generated DAEMON_TOOL_NAMES list, exported from @agentproto/runtime/daemon-tool-names. A runtime test boots a real gateway and keeps the list exact. The previously hand-listed names workflow_escalation_resolve and workflow_status are still in the generated list.
Changeset
| package | bump | reason |
|---|---|---|
| @agentproto/runtime | minor | new ./daemon-tool-names export |
| @agentproto/cli | patch | validation now uses the generated list |
The PR already ships .changeset/validate-daemon-tool-names.md with these bumps, so I'm not adding another.
Findings
Observations
packages/runtime/src/__tests__/daemon-tool-names.test.ts: the test compares against a realtools/list, so drift fails CI and the error message gives the regen command. The test also checks the file text againstrender(actual), so the formatting stays deterministic. That is a good guard.packages/runtime/tsup.config.tsandpackages/runtime/package.json: the new entry and export map are consistent. The CLI already depends on@agentproto/runtimeviaworkspace:*.packages/cli/src/commands/app-init.ts: a tool added in a newer daemon is rejected by an older CLI. The docs and the error message both say so, which is acceptable.- I read the diff only and did not run the tests or the build.
Verdict
LGTM ✅. The change is small, tested and documented.
🤖 @agentproto-bot — review · session sess_b3c39c16 (wf:agentproto-pr-review/review) · claude-sdk / subscription · model claude-sonnet-5-5 · e2b ib3js6t40kad5dud1mavo · $0.0960 · run 37507993334 · sha 288bc1a0caa310a2933028ba969f562c481e6f1c
|
@copilot see why that fails |
The failed PR check is a flaky timing assertion, not a failure in this PR’s changes. In CI run 37507993334, the only failing test is |
Problem
agentproto app validate, and through itagentproto catalog verify, checked an app'sui.toolsagainstKNOWN_NON_APP_TOOLS, a hand-kept list of 21 daemon tools in the CLI. agentproto/apps#2 (session-chat@0.1.0) fails on ~40 real daemon tools:adapter_list,catalog_models,session_queue_*,session_artifact_*,device_*,agent_set_model, ...Fix, at the source
DAEMON_TOOL_NAMES(packages/runtime/src/daemon-tool-names.generated.ts, exported as@agentproto/runtime/daemon-tool-names): 264 names, generated from a real gateway'stools/list.src/__tests__/daemon-tool-names.test.ts):agentproto servewires is stubbed, because several families only register when theirs is present: the workflow runner forworkflow_*, the pairing/host registry forpair_*anddevice_*,join_token_*,inbound_watcher_*. The llm-endpoint tools are registered on a scratch server, so no sidecar starts.pnpm --filter @agentproto/runtime gen:daemon-tool-namesregenerates the file (same test withUPDATE_DAEMON_TOOL_NAMES=1).app validateacceptsapp_*(unchanged) plus anyDAEMON_TOOL_NAMESentry. The error message no longer dumps the list.packages/runtime/srcandpackages/mcp-server/src(208, viaserver.tool(/registerTool() is in the generated list.Tests
workflow_status/workflow_escalation_resolvewere missing until the workflow runner was wired, which this test now guards).agentproto app validate projects/agent-apps/session-chat(agentik-studio) with this CLI:ok: true, no findings.@agentproto/runtime: 6075 passed;mcp-events-e2e(known timing flake) failed once and passes alone.@agentproto/cli: 1569 passed;resolve.test.ts > jcodeneedsadapter-jcodebuilt locally (unrelated).check-typesclean (runtime, cli). Docs:docs/cli/verbs/app.md.Release
agentproto/apps CI runs
npm install -g @agentproto/cli@latest, so apps#2 only goes green after this is in an npm release.