Subtraction, Simplicity & Conventions review — PR #686 (docs(api): document DeepSeek V4/V4.1 behavior for tool_choice required)
Key findings
The diff is already lean in the sense this lens normally polices: one hunk in docs/api.md (+14/−8), no runtime code, no flags, config knobs, wrappers, fallback branches, speculative generality or dead code introduced or left behind, and no duplication of an existing repo helper. What remains are three prose-level subtractions, ordered by value:
- should-fix (in the diff) —
docs/api.md:667-669invents the category name "shared lowering" (lifted from the locallet shared_lowering = …athelios/src/server/request.rs:467), then leans on it with a false definite ("that shared instruction"). The phrase appears nowhere else indocs/. The two encoder kinds can be named directly, which is shorter, exhaustive, and matches the file's existing style. The suggested rewrite also deletes one redundant clause and folds the final sentence: 9 lines/~110 words → 7 lines/~90 words. - should-fix (outside the diff) —
docs/core-design.md:1727-1728still carries the exact unconditional claim this PR corrects, and its own :1732 defers detail toapi.md. Merging #686 leaves the design document stating the thing the PR exists to fix. - minor (in the diff) —
docs/api.md:671backtickschatas if it were documented vocabulary; no sentence inapi.mddefines that value.
Explicitly not findings: the bundled rewrap of the Responses custom-tools lines (main docs/api.md:673-675 → head :679-681, byte-identical text) is required reflow of an over-long line, consistent with the file's ~78-column convention — not churn, nothing to remove; and the paragraph's restatement of "at least one completed call to a declared tool" is load-bearing (it is the answer to issue #445) and should be folded, not deleted.
1. Subtraction — what can be deleted or collapsed
Finding 1 (should-fix): invented implementation vocabulary plus a false definite
Location: docs/api.md:666-674 (PR head). The offending three lines verbatim:
tool. Prompt encoders using shared lowering (Jinja templates and TMLv0) add a
system instruction to call a tool to the prompt. The native DeepSeek V4 and V4.1
prompt encoders omit that shared instruction: in thinking mode they render
Why it is removable rather than merely wordy:
- The term is implementation shorthand, not a documented concept. Its only sources are
helios/src/server/request.rs:467—let shared_lowering = !frontend.prompt_encoder().renders_tool_choice();— and the doc comment athelios/src/frontend/mod.rs:152-153: "Other encoders receive the shared instruction messages instead." Adocs/search finds no other use of "shared lowering" or "shared instruction" (the only near-match is the unrelated "tool-result lowering" atdocs/api.md:855). .agents/skills/repo-prose/SKILL.md:22-25(not opened) forbids making "implementation shorthand … the vocabulary of the design", and:17-19forbids false definite references ("Phrases such as …this approachrequire a locally introduced, unambiguous referent") — "that shared instruction" has no referent outside the invented term.- The classification needs no name, because it is exhaustive without one:
renders_tool_choiceis true only forDeepseekV4 | DeepseekV41(helios/src/frontend/mod.rs:151-156), so the complement is exactly Jinja and TmlV0.docs/api.mdalready names encoder kinds directly at:721-722and:980("Native DeepSeek V4 and V4.1 prompt encoders acceptlow/high/xhigh/max…"), so naming them here is the established pattern, not a new style.
Concrete replacement for docs/api.md:666-674 (delete the three quoted lines and the trailing clause, insert this):
Required mode needs at least one declared tool. Jinja-template and TMLv0
encoders add a system instruction to call a tool to the prompt. The native
DeepSeek V4 and V4.1 encoders add none: in thinking mode they render required
mode identically to `"auto"`, so reasoning starts in `<think>`, and in
non-thinking mode their template ends the prompt after the DSML tool-call
opener, so output begins inside the tool-call block. Completion validation is
unchanged in either mode: generation must produce at least one completed call to
a declared tool.
What this deletes: the phrase "using shared lowering", the false definite "that shared instruction", the redundant trailing clause "so generation starts inside the tool-call envelope" (it restates "opens the DSML tool-call block at the end of the prompt"), and the separate "In all modes, including DeepSeek thinking mode, completion validates that …" sentence, folded into the shorter final clause. Net 9 lines/~110 words → 7 lines/~90 words with strictly more information per line.
Finding 3 (minor): undefined backticked identifier
Location: docs/api.md:670-671:
required mode identically to `"auto"` so reasoning starts in `<think>`, and in
non-thinking (`chat`) mode their template opens the DSML tool-call block at the
The backticked chat is the value accepted by the native option (thinking_mode: "chat" / enable_thinking: false, helios/src/frontend/deepseek.rs:181-190), which docs/api.md never documents as a spelling: :1005-1006 lists only what these encoders reject ("Both native DeepSeek encoders reject drop_thinking, assistant continuation, and add_generation_prompt=false.") and :984 mentions chat_template_kwargs only in the effort context. Simplification: drop the parenthetical (the replacement in Finding 1 does exactly that), or, if the identifier is wanted, name the option once at first use and then refer to it plainly. A backticked token that the document never introduces is a dangling reference the reader has to resolve from the source.
2. Simplicity & duplication
No logic, no helper, no abstraction — nothing in this diff duplicates a repo helper. Two duplication questions were checked and do not need action:
- The rewrap of the Responses custom-tools lines (
docs/api.mdmain:673-675→ head:679-681: "Responses also supports text custom tools by presenting a JSON{ "input": string }function …") is byte-identical text reflowed to the file's column width. It is required reflow after the paragraph above it grew, not churn, and nothing should be removed. - The fourth statement of the completion rule. "At least one completed call to a declared tool" already appears at
docs/api.md:654-655,:700-701and:759-760. Here it is load-bearing — the whole point of #445/#686 is that DeepSeek gets no prompt instruction yet is still enforced at completion, so a reader must see both halves together. Do not delete it; Finding 1's rewrite folds it into one clause instead of two.
No speculative generality, no dead code, no removable flag or branch: the PR touches only prose; the behaviour it documents (renders_tool_choice, the Required → Auto downgrade in helios/src/frontend/deepseek.rs:272-280) predates it and is out of scope for removal here.
3. Material repo conventions
Finding 2 (should-fix): stale claim left behind in docs/core-design.md
Location: docs/core-design.md:1727-1731:
`tool_choice=required` adds a prompt instruction and requires a completed call
to a declared tool. Without a grammar it uses ordinary sampling. Named tool
selection filters the definitions to that tool; it does not by itself enable a
grammar. The encoder requires a completed call to the selected tool and rejects
other tool names.
:1732 then defers detail to the PR's own file: "See the API contracts for the accepted strict schema subset, parser formats, protocol mappings and streamed errors." After #686 merges, the design document still asserts unconditionally the claim maintainer triage called "not true for these recipes" (yatesdr on issue #445, 2026-11-21). .agents/skills/repo-prose/SKILL.md:26-29 (not opened): "Documentation is a present-state specification, not a changelog. Replace stale claims instead of layering history on top."
Subtractive fix (one clause deleted, no new text needed):
`tool_choice=required` requires a completed call to a declared tool. Without a
grammar it uses ordinary sampling. Named tool selection filters the definitions
to that tool; it does not by itself enable a grammar.
If the reviewer prefers to keep the whole change inside docs/api.md, the alternative is to qualify in one short parenthetical ("…; native DeepSeek V4/V4.1 encoders add none, see api.md") — but plain deletion is the smaller edit and leaves the deferral at :1732 doing its job.
Not a convention violation
AGENTS.md's four-part PR template is followed by the description (why / what / expected result / evidence + limitation), the declared scope matches the diff, and no changelog or "defect report" framing was introduced. No "designed, not implemented" marker is needed because the text describes shipped behaviour, and correctly nothing was added to docs/TODO.txt (yatesdr called this behaviour deliberate rather than a defect).
Open questions / could not verify
- Whether the maintainer who requested this correction (yatesdr) intends
Fixes #445to close an issue whose behavioural half was declined; nothing on #686 addresses it. Not this lens's call, but it is why Finding 1's rewrite keeps the completion-validation sentence prominent. - Whether
docs/core-design.md:1727-1728is scheduled for a follow-up (Finding 2) or the divergence is accepted — no open PR or issue does it. - Coordination with #461 (same author, open, CHANGES_REQUESTED), which edits the adjacent required/named paragraph (
docs/api.md:649-655, "adding no instructions or decoding constraints"). If both land, required mode is described across two separately-written paragraphs; the wording of Finding 1's rewrite does not conflict textually but was not written against #461's proposed text, which is not indocs/api.mdat this head. - No build, test or rendered-markdown check exists on this branch (author-declared); nothing in a prose-only diff can affect either, so this is irrelevant to the findings above.