fix(timeout-policy): warn on configured-but-unregistered tool names

ds-review-bot flagged that a typo'd or stale config key (e.g. web_fech for
web_fetch) silently applies the timeout to nothing — the tools/execute lookup
just never matches. Mirror dsh-tool-subagent's lifecycle-driven handling of a
configured-but-unregistered provider: on every tools/change (and once at load),
logger.warn each configured name still absent from ctx.tools, warning each name
at most once so a late registration silences it. Not a load-time throw — the
tool set is dynamic (cordis.yml load order, HMR), so a real tool may register
later.

Declare inject = ['tools'] since the plugin now reads ctx.tools synchronously
in apply (previously only inside event callbacks). Regenerate config-catalog
(Requires: tools) and event-producer-consumer graph.
This commit is contained in:
Dudu-0223
2026-07-08 11:43:29 +08:00
parent a76285c4e6
commit 3265bdbf70
5 changed files with 99 additions and 3 deletions

View File

@@ -604,6 +604,8 @@ Source: [`packages/core/system-prompt/src/index.ts:179`](../packages/core/system
## `@deepseek-ai/dsh-timeout-policy`
Requires: `tools`
```ts config-catalog
/**
* Plugin config: per-tool timeout policy, keyed by the model-facing tool name.
@@ -623,7 +625,7 @@ export interface ToolTimeoutPolicy {
}
```
Source: [`packages/timeout/timeout-policy/src/index.ts:61`](../packages/timeout/timeout-policy/src/index.ts)
Source: [`packages/timeout/timeout-policy/src/index.ts:64`](../packages/timeout/timeout-policy/src/index.ts)
## `@deepseek-ai/dsh-tool-fs`