Skip to content

feat(anthropic): adaptive thinking-effort envelope (DTE series 2/5) - #40

Closed
easonLiangWorldedtech wants to merge 1 commit into
feat/dte-v2-4-effort-persistencefrom
feat/dte-v2-5-adaptive-effort-envelope
Closed

feat(anthropic): adaptive thinking-effort envelope (DTE series 2/5)#40
easonLiangWorldedtech wants to merge 1 commit into
feat/dte-v2-4-effort-persistencefrom
feat/dte-v2-5-adaptive-effort-envelope

Conversation

@easonLiangWorldedtech

Copy link
Copy Markdown
Owner

≤400-line redo of Zoo-Code-Org#1338 — DTE series 2/5, unit 5/5

Anthropic adaptive thinking-effort envelope (DTE-2d): the effective per-request
thinking effort is resolved at the shared resolveEffectiveReasoningEffort
point (per-request override → settings → model default), and adaptive-thinking
requests whose effective effort is in-range (low|medium|high|xhigh|max)
carry output_config: { effort } on the message request; out-of-range or
unset efforts omit the envelope so the API default applies. Both the streaming
and non-streaming request sites get the envelope.

Stack

Budget (plan §2: a+d ≤ 400)

2 files changed, 340 insertions(+), 1 deletion(-) = 341 ≤ 400

File a+d
src/api/providers/anthropic.ts 43+/1−
src/api/providers/__tests__/anthropic-adaptive-effort.spec.ts (new) 297+

Provenance / fidelity

  • Both files are whole-file extracts, blob-identical to the union
    27a2e97df (anthropic.ts blob c0843d29a, spec blob 7f37b8dc),
    taken from 77ec064d3 (DTE-2 content tip). No 3-way merge needed: the
    anthropic.ts region the slice touches is drift-free at the U4 head
    (verified: empty diff of anthropic.ts between the dte-2 base
    39bdfb188 and the U4 head).
  • anthropic.ts delta = 6ea45b36a (28+/1−: shared imports, envelope
    resolution, both request sites) + 90b47b053 (+15: createMessage JSDoc).
  • Exclusion (stale plan row): webview-ui/src/components/settings/__tests__/ExperimentalSettings.spec.tsx
    (1+/75−) is NOT part of this unit.
    Forensics (diff 39bdfb188..77ec064d3)
    proves the DTE-2 series never touched that file — its
    dynamicThinkingEffort block and fireEvent import arrived via
    U1/main and are already present at the U4 head (blob 3feddad1, identical
    to the union). The real +75 for that file belongs to Wave 3 (U11).
  • src/eslint-suppressions.json: untouched (no U5-owned count changes).

Out of scope (series complete)

  • None — U5 completes DTE series 2/5 (U1–U5 all ≤ 400). Next: Wave 3 (dte-3,
    from b17373bb9).

Verification (local)

  • pnpm --dir src exec eslint --prune-suppressions --max-warnings=0 api/providers/anthropic.ts api/providers/__tests__/anthropic-adaptive-effort.spec.ts → exit 0, no count change
  • pnpm check-types → 11/11 projects
  • pnpm --dir src exec vitest run api/providers/__tests__/anthropic-adaptive-effort.spec.ts → 20/20 (1.03 s)
  • git diff --shortstat 111cf40ae HEAD → 340+/1− = 341 ≤ 400

@easonLiangWorldedtech

Copy link
Copy Markdown
Owner Author

Superseded — U5 will be opened on upstream (Zoo-Code-Org/Zoo-Code) when its stack slot opens (max 3 open DTE-v2 PRs, ship plan 2.2). Head d77abcd unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants