From 412544881d1db4ffaff8fbd08cf36695c8b91532 Mon Sep 17 00:00:00 2001 From: Seungwoo Jeong Date: Mon, 17 Aug 2026 10:24:42 +0900 Subject: [PATCH] feat(prompt-preset): add delegation + skill gates to deepseek-v4 and kimi-k3 [draft] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DeepSeek V4 (flash/flash-0731/pro) and Kimi K3 under-delegate and under-load skills vs GPT (K3 0.21% task rate, DeepSeek first delegate avg 62.3 msgs, 0 SKILL.md reads). This draft ports the canary's 4 rules into builtins for review while the canary measures M1-M4 at ~20 qualified turns (Appendix B gates). - deepseek-v4.ts 5→7 rules: delegate-separable-work + load-matching-skills (subagent-delegation / skill-utilization, ALL_PRESETS) - kimi-k3.ts core: two new paragraphs under Working the Task — delegation once at intake + visible-skill terminal gate (verbatim from canary) Tests: 66/66 pass. Prompt-behavior-coverage (no pinned prose) holds. Evidence: existing preset tests render once per rule. --- packages/coding-agent/CHANGELOG.md | 2 ++ .../builtin/prompt-preset/deepseek-v4.ts | 20 +++++++++++++++++-- .../builtin/prompt-preset/kimi-k3.ts | 2 ++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 56627d4e84..f4a2999aa9 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -1219,6 +1219,8 @@ ### Fixed +- DeepSeek V4 (flash/flash-0731/pro) presets now carry delegation and visible-skill gates; Kimi K3 adds the skill gate alongside the redesigned core's existing bounded delegation rule. This remains a draft canary pending at least 20 qualified turns (see PR #912). + - Extension selectors (including the `/fallback` model picker) now window long option lists around the highlighted row instead of rendering every entry. On large model registries the full list overflowed the viewport and the moved highlight was never painted, so arrow keys and j/k appeared to do nothing even diff --git a/packages/coding-agent/src/core/extensions/builtin/prompt-preset/deepseek-v4.ts b/packages/coding-agent/src/core/extensions/builtin/prompt-preset/deepseek-v4.ts index de12ab10ca..c1dea68212 100644 --- a/packages/coding-agent/src/core/extensions/builtin/prompt-preset/deepseek-v4.ts +++ b/packages/coding-agent/src/core/extensions/builtin/prompt-preset/deepseek-v4.ts @@ -22,9 +22,11 @@ export type DeepseekV4RuleId = | "todo-discipline" | "missing-info" | "settled-reading" - | "reasoning-aim"; + | "reasoning-aim" + | "delegate-separable-work" + | "load-matching-skills"; -export type DeepseekV4Concern = "harness-contract" | "todo" | "grounding" | "deliberation"; +export type DeepseekV4Concern = "harness-contract" | "todo" | "grounding" | "deliberation" | "subagent-delegation" | "skill-utilization"; export type DeepseekV4PresetName = "deepseek-v4-flash" | "deepseek-v4-flash-0731" | "deepseek-v4-pro"; @@ -74,6 +76,20 @@ export const DEEPSEEK_V4_RULES: readonly DeepseekV4Rule[] = [ directive: "Aim extended reasoning at the problem - the code, the design, the failure - and end it in an action. When reasoning stalls on a missing fact, stop deliberating and fetch the fact; a cheap read beats a long internal debate. Deliver a conclusion and a recommendation, not a survey of options.", }, + { + id: "delegate-separable-work", + concern: "subagent-delegation", + presets: ALL_PRESETS, + directive: + "At task intake, partition the work into the local critical path and separable workstreams. A bounded workstream that does not depend on the parent's in-progress edits is a `task` call: spawn it before local implementation, and submit independent workstreams in one batch. Keep only trivial lookups and tightly coupled edits local. Delegation is complete only after every child result has been read and its evidence integrated into the parent answer.", + }, + { + id: "load-matching-skills", + concern: "skill-utilization", + presets: ALL_PRESETS, + directive: + "Before the first non-discovery action, compare the task with every visible skill description. For each loose match, read that skill's listed `SKILL.md` and follow it; when matching work is delegated, include the skill name in `load_skills`. Proceed without a skill only after this scan finds no match - recognizing a match without loading it does not complete the gate.", + }, ]; export function buildDeepseekV4FlashIntro(modelLabel: string): string { diff --git a/packages/coding-agent/src/core/extensions/builtin/prompt-preset/kimi-k3.ts b/packages/coding-agent/src/core/extensions/builtin/prompt-preset/kimi-k3.ts index 51bb3b8b96..c5dab08603 100644 --- a/packages/coding-agent/src/core/extensions/builtin/prompt-preset/kimi-k3.ts +++ b/packages/coding-agent/src/core/extensions/builtin/prompt-preset/kimi-k3.ts @@ -80,6 +80,8 @@ Before each response, list what you need next, then request every item that does ${buildExecutionToolingParagraph({ toolNames: context.tools.map((tool) => tool.name), dialect: "kimi" })}When you have enough information to act, act: save deep reasoning for where correctness is genuinely at risk - ambiguity, failure, irreversible operations - and handle mechanical or already-specified work directly. Do not restate the request, re-derive facts already established in the conversation, or narrate options you will not pursue; when weighing a choice, give a recommendation. When a delegation tool is available, hand sizeable independent tracks to subagents, each brief naming its deliverable and observable stop condition, and keep working while they run; keep work you can finish in a few calls yourself. +Make the visible-skill scan a terminal gate before substantive work: compare the task with every listed description, read each loosely matching \`SKILL.md\`, and apply it. If matching work is delegated, pass its skill name in \`load_skills\`. The gate is complete only when all matches are loaded or the scan finds none. + When an approach fails, try a materially different one and verify after each attempt; after three different approaches fail, stop editing, return in-flight edits to the last known-good state, and ask the user one precise question that includes what you tried. ## Verification