Files
deepseek-harness/packages/client/ui-question/src/index.ts
Yichen Jiang 9ac1547335 fix(web): stop leaking ask_user_question into every preset
`ui-question`'s node half called `ctx.tools.register` on the host context.
`ScopedLayers.merge()` combines the global layer with the agent's exact-scope
layer, and an unscoped registration lands in the global one — so the tool
reached every agent no matter which preset composed it. `core-web`, sold as
a two-tool benchmark surface, really presented three, and a locally authored
`bash-only` preset presented two.

Rendering a question is a host UI capability; having the tool is an agent
capability, and only a preset decides that. The node half is now empty and
the `tool-ask-user` row moved into the presets that want it. The TUI keeps
its own row, having no presets.

The web composition test now asserts the global tool layer is EMPTY, which
is the invariant that would have caught this: any tool outside a preset
reaches every agent.
2026-08-07 00:41:50 +08:00

15 lines
686 B
TypeScript

/**
* Web question plugin, node half.
*
* Deliberately empty. Mounting `ask_user_question` here put it in the tools
* registry's GLOBAL layer, so every agent saw it no matter which preset
* composed it — a two-tool benchmark preset actually presented three, and a
* locally authored `bash-only` preset presented two. Rendering a question is
* a host UI capability; having the tool is an agent capability, and only a
* preset decides that. The `tool-ask-user` row belongs in the presets that
* want it (and in the TUI composition, which has no presets).
*/
/** Host plugin body — the model-facing tool is composed per preset, not here. */
export function apply(): void {}