feat(dte): dynamic thinking effort — full series trial (PRs 1-5 + e2e addenda merged) - #29
Open
easonLiangWorldedtech wants to merge 49 commits into
Open
feat(dte): dynamic thinking effort — full series trial (PRs 1-5 + e2e addenda merged)#29easonLiangWorldedtech wants to merge 49 commits into
easonLiangWorldedtech wants to merge 49 commits into
Conversation
…nd adaptive effort envelope DTE series 2/5 (part of Zoo-Code-Org#1329). - ApiHandlerCreateMessageMetadata.reasoningEffort: per-request override channel - resolveEffectiveReasoningEffort: single shared resolution point (override > settings > model default) - AnthropicHandler: adaptive output_config.effort envelope in both requestParams branches (in-range only) - Task: setRuntimeThinkingEffort/getRuntimeThinkingEffort with in-memory apiConfiguration merge/restore, per-request metadata at all four createMessage sites, dispose() reset; never persisted
DTE series 2/5 — addresses the CodeRabbit review finding on Zoo-Code-Org#1338: when a task-local thinking-effort override is active, updateApiConfiguration() now re-captures the incoming profile's reasoningEffort as the restore value and re-applies the override on top of the new in-memory copy, so clearing the override restores the NEW profile value instead of the stale one. Additive: activation and clearing semantics are otherwise unchanged. Adds two regression tests (override active + profile switch restores new value; inactive updateApiConfiguration unchanged behavior).
DTE series 2/5 — addresses the CodeRabbit docstring-coverage warning on Zoo-Code-Org#1338 (33.33% < 80% across the functions touched by the diff): - AnthropicHandler.createMessage: documents the shared effective-effort resolution and the adaptive output_config.effort envelope (in-range only). - Task.dispose: documents centralized teardown incl. the transient task-local override reset. - Task.updateApiConfiguration: documents the override-preservation behavior (re-captured restore value + re-applied override on the new in-memory copy). Comment-only change: 30/30 patch lines and 10/10 branches unchanged; 317/317 tests and tsc --noEmit re-verified green.
…/dte-3-native-tool
Add the set_thinking_effort native tool (DTE series 3/5): the model adjusts its own per-turn thinking effort mid-task with no approval gate. - Guardrails: one-line chat notification (success or refusal), escalation cap (max 3 upward changes per task), A->B->A oscillation refusal, hard clamp to the model capability array (ties toward the lower level). - Gating: dynamicThinkingEffort experiment + model supportsReasoningEffort (non-empty array or true), evaluated at task start so the tool list stays stable within a task (prompt-cache safety). - Display: webview ChatRow one-line row (applied / oscillation / escalation refusal), i18n keys in all 17 locales; partial streaming updates the same line. - Tests: executor (clamp/cap/oscillation/no-op/no-approval/display), parser (partial + complete), dispatch, gating matrix, schema wiring, ChatRow display. Stacked on DTE PR-1 (experiment flag) and PR-2 (task-local runtime effort state). Closes Zoo-Code-Org#1330.
Address PR review feedback on set_thinking_effort (DTE series 3/5): - Executor: seed the per-task guard history with the task's effective baseline so returning from a changed value to the original baseline is refused as oscillation (A -> B -> A); existing no-op behavior preserved. - Parser: only build nativeArgs when effort AND reason are strings; a non-string payload now fails at parse time and cannot reach the executor. - Gating: a supportsReasoningEffort array that only lists 'disable' no longer exposes the tool (it could apply no level). - i18n: translate the new thinkingEffort chat strings into all 17 non-English webview locales (placeholders preserved). - Tests: regression tests for each change plus branch-coverage for the previously partial lines (non-string args, 'disable'-only capability, baseline oscillation, partial streaming without params, description fallback, capability robustness). All touched patch lines are now fully branch-covered (codecov patch partials resolved). CodeRabbit: Zoo-Code-Org#1354
… post-mode-switch revalidation, ask prefill normalization)
…e, in-chat display
…tadata in say-rejection test
…real Task contract
…ent flag The manual user-facing surfaces (composer bottom-bar toggle and task header chip) are now normal features: they render whenever the selected model advertises per-request reasoning effort support (supportsReasoningEffort boolean-true or a non-empty level array), regardless of the dynamicThinkingEffort experiment flag. - computeThinkingEffortDisplay() no longer takes the experiment flag and returns null only when the model does not advertise per-request effort support. - ThinkingEffortToggle and TaskHeader stop reading `experiments` from the extension state for this display. - The dynamicThinkingEffort experiment now gates only the model-driven set_thinking_effort tool exposure. The rest of the extension-side pipeline (setTaskThinkingEffort handler, taskThinkingEffort state push, per-request effort envelope) was already ungated. - Playwright CT fixture keeps its experiment-on initial state so the baselines render the identical component state (verified: 0 baseline drift).
Filter model capability entries to SETTABLE_EFFORTS plus disable before nearest-level selection so a capability array containing only unrecognized values (e.g. [weird]) is refused via the standard tool-error path instead of being applied as the runtime effort. Add unit coverage for all-garbage and mixed garbage capability arrays.
Replace the any-typed renderChatRow/sayToolMessage helpers with the ClineMessage type and a ThinkingEffortSayTool payload shape (thinkingEffort tool discriminator over ClineSayTool fields), preserving the existing fixture values.
Translate the DYNAMIC_THINKING_EFFORT name/description out of English in zh-CN, ja, ko, ru, de, ca, pt-BR, tr, vi, nl and pl, matching the terminology already used in each locale chat.json thinkingEffort strings. find-missing-translations --area=webview is clean.
…: manual surfaces ungated from experiment)
…rial-local; lands upstream via dte-3 Zoo-Code-Org#1354)
7 tasks
… display strings (18 locales)
…oggle; default-source label
… display strings (18 locales; trial-local, mirrors dte-4 e298f26)
…i18n emoji/space, toggle value+hover, default-source label, baselines)
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.
Trial branch: all DTE (dynamic thinking effort) branches composed into ONE
This branch merges the entire DTE 5-PR series + both e2e addenda so it can be tried out as a single build. It is NOT a submission PR - the real PRs are on Zoo-Code-Org/Zoo-Code:
Merge history (all additive, no rebase)
19954d3 (dte-3 head) -> merge dte-4 (3ae54d1; 17 locale i18n conflicts resolved as union: dte-3 translations + dte-4 new keys) -> merge dte-5 (5b33232; 2 conflicts in vscode-extension-host.ts resolved keep-both) -> merge dte-5-e2e (ce0e90b) -> merge dte-3-e2e (f152b98).
Verified
How to try it
Base: main @ 78c712a (same as upstream main at branch time).