feat(api): per-request thinking effort override and adaptive effort envelope (DTE series 2/5) - #37
Closed
easonLiangWorldedtech wants to merge 1 commit into
Conversation
…nvelope (DTE series 2/5)
Owner
Author
|
Superseded by upstream PR Zoo-Code-Org#1522 (DTE-v2 stack moved upstream — CodeRabbit only runs there). Same head 82358bd, same content. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the DTE-v2 stack (≤400-line redo of Zoo-Code-Org#1338); this PR: adds per-request thinking-effort resolution (DTE-2) — the
ADAPTIVE_OUTPUT_CONFIG_EFFORTSconstant and theresolveEffectiveReasoningEffortprecedence helper insrc/api/transform/reasoning.ts, the transientreasoningEffortfield onApiHandlerCreateMessageMetadatainsrc/api/index.ts, and the accompanying spec.Stack: base =
feat/dte-v2-1-dynamic-thinking-effort(U1, PR #36, head19788c03). Standalone diff vs that base:113 additions + 1 deletion = 114 lines (≤400 budget). (measured with
git diff --shortstat 19788c031667fc1e367511fb9026607652e0f9cb HEAD)Related issue: #35 (DTE-v2 series tracking)
Amendments folded in (from
plans/dte-gap-review.md): none for this unit.Out of scope: the task-local runtime effort state and thinking-effort switch re-validation (U3), the persisted history / settings round-trip (U4), and the Anthropic adaptive
output_config.effortenvelope wiring that consumes these primitives (U5). This unit lands the resolution primitives and the API-surface metadata field only; no consumer readsmetadata.reasoningEffortyet.Pre-submission checklist:
pnpm check-types(11/11), targeted vitest (dte-effective-reasoning-effort.spec.ts8/8),eslint --prune-suppressions --max-warnings=0(exit 0; the three files carry no suppressions, sosrc/eslint-suppressions.jsonis untouched by this PR)resolveEffectiveReasoningEffort(override > settings > model default, thedisablesentinel, out-of-envelope override passthrough, undefined) and pinsADAPTIVE_OUTPUT_CONFIG_EFFORTSto the exact adaptive envelope set (mutation-gate corollary for the array literal)Binary files in this PR: none
Content fidelity note (union extraction):
27a2e97df(tagdte-legacy/union), legacy commit6ea45b36a— "feat(task): task-local thinking effort state, per-request override, and adaptive effort envelope".src/api/transform/reasoning.ts(+45) and the new spec (+58) are taken whole-file from the union; the per-file union history confirms no later DTE unit modified them.src/api/index.tsis hunk-surgery: only theReasoningEffortExtendedimport and thereasoningEffortmetadata field (+9) are taken from the union. The union's removal of thecase providerIdentifiers.geminiCli:fall-through line is a base-drift artifact (the union branch predates that upstream addition tomain) and is deliberately not taken — thegeminiClicase is preserved (the pre-commit prettier pass also normalized the indentation of that case's pre-existing comment by one tab — the PR's single deletion; the case line itself is unchanged).src/shared/__tests__/experiments.spec.ts(the ledger's 4th file for the legacy DTE-2a commit) needs no change here: it already matches the union state in the U1 base (empty diff vs27a2e97df), so that ledger line is already contained in PR feat(settings): dynamic thinking effort experimental toggle (DTE-1) #36.Verification (local, worktree
wt-dte-v2-2, basefeat/dte-v2-1-dynamic-thinking-effort@19788c031667fc1e367511fb9026607652e0f9cb):pnpm check-types→ 11/11 greenpnpm --dir src exec vitest run api/transform/__tests__/dte-effective-reasoning-effort.spec.ts→ 1 file / 8 tests passedpnpm --dir src exec eslint --prune-suppressions --max-warnings=0 api/index.ts api/transform/reasoning.ts api/transform/__tests__/dte-effective-reasoning-effort.spec.ts→ exit 0, no suppression entries in the three filesgit diff --shortstat 19788c031667fc1e367511fb9026607652e0f9cb HEAD→ 3 files, 113+ / 1− = 114 lines