/** * [ref]④ defer face — EXPERIMENTAL long-tail per-tool defer (default OFF, `TOOL_DEFER_LONGTAIL=true`). * * Mechanics (core 7.15.0 `core/runner/tool-defer-gate.ts`, 亲读装树 dist —— 规则从八条收成两条): * - 候选**只可能**是 caller spec 工具(scenario/user tools)、远端协议铸名(MCP / A2A)与内置自声明 * defer 的那对;core 一方名册(Bash/Read/Edit/Grep/Glob/Write/…)结构上永不进候选,所以 CC「12 只 * 一方工具内联」的姿态**零 server 动作**即成立; * ⚠️ **这句在中间那些世代上一度不成立**([ref] 件⑤ 对表):`deferMode:"auto"` 的压力阀曾把内建 fs 族 * 也卷进候选,小窗模型上首用即激活错;core 5.40.0([ref] a 案,判据帖 [ref] 翻面清单 #3)把阀候选 * 收回 caller specs,**内建恒 inline**,于是这句话重新为真。**对本仓零行为影响**——理由是下一条: * 我们从不开 auto。这一段留着是因为它是那次漂移的出处(数字对了而理由没对,是最难查的一类)。 * - 🔴 **候选 ≠ 延迟**(core 7.15.0 [ref] 的行为面收窄,本仓两条真后果见下):候选集整体受**一道** * 阈值门,全或无 —— 候选的内联字节(name+description+schema)≥ `floor(上下文 token × 10%) × 3` * 才延迟,否则**全内联且不挂 `ToolSearch`**。远端协议铸名因此**不再无条件占位**:本仓缺省窗 * (`MODEL_CONTEXT_WINDOW=262144`)下阈值 = 78 642 字符,一个中小 MCP 名册够不着 ⇒ 首请求带全 schema。 * 唯一不受门的是调用方的 `TaskSpec.deferTools` 字面名单(按字面恒延迟、不计量)。 * - `RunnerDeps.deferMode:"auto"` 不是第二道门,而是把候选集**拓宽**到全部 caller spec 后走同一道门 —— * 在本仓缺省场景下那会连 Agent 与 Task 四件一起卷进候选(与 CC 姿态相反),所以我们**刻意不开**; * 🔴 该判断在 core 5.40.0 / 7.15.0 上**逐字仍成立**(亲验):两次收窄动的都是「候选集是谁」,而 * Agent / Task 四件是 **caller spec 工具**,收窄后照样在候选池里 —— 不开 auto 的理由没有被消解。 * 我方**从不接线**这个座:全树零 `RunnerDeps.deferMode` 赋值(`deferModelPlane` 是 config-center 的 * 同形近名,与本轴无关)。机器钉见 test/tool-defer.test.ts 的 [ref] 件⑤ 格 —— 这条「零接线」正是本仓 * 在两个 core 世代之间行为逐字不变的**全部**依据,所以它值一根钉而不只是一句注。 * - per-tool `ToolSpec.defer:true` 是本 helper 施加的那一位。**7.15.0 起它是一次「进候选集」的声明, * 不再是「一定占位」的保证** —— 长尾集单独一只(下面实测 ≈842 字符)远在阈值之下,于是这根旋钮在 * 没有 MCP/A2A 名册的部署上是个 no-op;有名册时它把自己的字节并进同一张账,帮助(或不帮助)开门。 * ⚠️ 不要为了「恢复旧效果」把它改挂 `TaskSpec.deferTools`:那是调用方的轴,由下游改写上游刚裁定的 * 语义,属于跨仓纪律明禁的旁路;要改口径请回 core 提。 * * Measured inline surface (chars = description + JSON schema; ÷4 ≈ tokens), default scenario @ core 1.289: * Agent 5400 · TaskUpdate 3286 · TaskCreate 2661 · SendUserFile 1282 · TaskList 1075 · SelectEnvironment 842 · * WebSearch 817 · WebFetch 771 · TaskGet 689 · Now 140 → total ≈17k chars ≈ 4.2k tokens. * Judgment: Agent + Task quartet (+WebFetch/WebSearch) = CC-core posture, stay inline. SendUserFile = the * proactive-delivery product face — deferring it hides it behind ToolSearch and suppresses exactly the * spontaneous "send the user the artifact" behavior it exists for → NOT in the defer set. That leaves * SelectEnvironment (~210 tokens; a discover-then-bind verb whose trigger scenario plausibly drives a * ToolSearch query) as the only honest candidate — a marginal win, hence experimental + default off, with the * final call left on the board ([ref]③ honesty-over-preemption). */ import type { ToolSpec } from "@sema-agent/core"; /** The long-tail set (names). Deliberately tiny — see the module header for why each other tool is excluded. */ export declare const LONGTAIL_DEFER_TOOLS: ReadonlySet; /** When `enabled`, return the tools with the long-tail members marked `defer:true` (copies — the input specs * are shared singletons and must not be mutated). Disabled ⇒ the array is returned untouched (no copies). */ export declare function applyLongtailDefer(tools: ToolSpec[], enabled: boolean): ToolSpec[]; //# sourceMappingURL=tool-defer.d.ts.map