feat(task): task-local runtime thinking effort state with per-request override (DTE series 2/5) - #38
Closed
easonLiangWorldedtech wants to merge 1 commit into
Conversation
… override (DTE series 2/5) - Task: setRuntimeThinkingEffort/getRuntimeThinkingEffort with in-memory apiConfiguration merge/restore; per-request metadata at all four createMessage sites; profile-switch re-capture in updateApiConfiguration - Transient state only: never persisted to settings or history - Tests: 8 focused vitest cases (state machine, profile switch, metadata fragment, non-persistence) Part of #35 (DTE-v2 ship plan, unit 3/5).
easonLiangWorldedtech
force-pushed
the
feat/dte-v2-3-task-runtime-effort
branch
from
September 4, 2026 07:42
d0b1a3d to
4075c8a
Compare
8 tasks
Owner
Author
|
Superseded by upstream PR Zoo-Code-Org#1523 (DTE-v2 stack moved upstream — CodeRabbit only runs there). Same head 4075c8a, 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.
≤400-line redo of Zoo-Code-Org#1338 — DTE series 2/5, unit 3/5
Task-local runtime thinking-effort state on
Task: the in-memory overridechannel, its per-request delivery at all four
createMessagesites, and theprofile-switch re-capture in
updateApiConfiguration. Transient state only —nothing is persisted; persistence is the next unit (U4).
Stack
feat/dte-v2-2-per-request-effort@82358bdfc(U2, PR feat(api): per-request thinking effort override and adaptive effort envelope (DTE series 2/5) #37)feat/dte-trial-allunion27a2e97df(tagdte-legacy/union), U3 sliceBudget (plan §2: a+d ≤ 400)
2 files changed, 397 insertions(+), 1 deletion(-)= 398 ≤ 400 ✓src/core/task/Task.tssrc/core/task/__tests__/Task.runtime-thinking-effort.test.ts(new)Budget deviation note (plan §2.6). The plan estimated U3 at ~355
(Task +132/−3 + tests ≈220); those numbers were stale. Measured against the
union, the U3 slice is Task +105/−1 + a 311-line test file = 417 > 400. Per
§2.6 (no budget bypass), the dispose boundary group is split into U4:
the task-end override reset (6 Task lines + 3 DTE JSDoc lines) and its
12-line
describe("dispose")test block. This matches the plan's own U4 scopeline ("persistence + boundary cases"). U3 keeps the generic 4-line
dispose()JSDoc; U4 expands it with the DTE sentence alongside the reset code.
Provenance / fidelity
Task.ts: 3-waygit merge-file— base39bdfb188(=6ea45b36a^),ours = U2 head, theirs =
90b47b053(the last U3 commit, before the U4persistence work). Zero conflicts. A whole-file extract was impossible:
the union's
Task.tscarries U14-orchestrator and U4/U5 content(215+/241− vs U1 head), and per-commit
git apply --3wayof the U3 patchesfails on upstream base drift.
90b47b053version (311 lines) minus the disposedescribe (12 lines + separator), plus the 3 mutation-killing assertion
lines below = 301 lines; the header comment is trimmed to the U3 scope
("the task-end reset in dispose()" clause moves with U4).
taskMetadata.ts/history.tspersistence changes,the
describe("history persistence round-trip")anddescribe("abortTask final save")blocks, and theHistoryItemimport(unused in the U3 slice).
src/eslint-suppressions.json: untouched. The union's +8/−3 suppressiondeltas are all in files owned by other units
(
gemini-format.spec.ts5→6,ask-queued-message-drain.spec.ts18→32,newTaskTool.spec.ts26→31, newextension.ts1) — none U3-owned.Out of scope (next units)
taskMetadatamerge propagation, and the task-end override reset split outabove (dispose boundary + its test).
output_config.effortadaptive envelope.Mutation-diff fix (killing assertions, plan L42 — same PR)
The first CI
mutation-diffrun (headd0b1a3dcd) reported 2 SurvivedConditionalExpressionmutants — both on the two ternaries this unitintroduces:
setRuntimeThinkingEffortsource capture:effort === undefined ? undefined : sourcesource: a label passed on a clearing call leaks intosourcesetRuntimeThinkingEffort(undefined, "stale-source")); the existingsource: undefinedassertion then kills the variantgetRuntimeThinkingEffortMetadata:effort !== undefined ? { reasoningEffort } : {}{ reasoningEffort: <maybe undefined> }not.toHaveProperty("reasoningEffort")while unset —toEqual({})cannot kill it (toEqual ignores keys whose value isundefined); asserted pre-set and post-clearThe complementary variants (L1683-true, L1721-false) were already killed by
the existing
toBe("test-source")andtoEqual({ reasoningEffort: "high" })assertions.
Local dev-stage gate on the amended head (§5.1):
node scripts/stryker-diff.mjs ci --base 82358bdfc --head 4075c8a75→extension 35 changed lines, 18 ranges, exit 0, 0 Survived.
Verification (local)
pnpm --dir src exec eslint --prune-suppressions --max-warnings=0 core/task/Task.ts core/task/__tests__/Task.runtime-thinking-effort.test.ts→ exit 0 (no suppression-count change)pnpm check-types→ 11/11 projectspnpm --dir src exec vitest run core/task/__tests__/Task.runtime-thinking-effort.test.ts→ 8/8 (18.8 s)git diff --shortstat 82358bdfc HEAD→ 397+/1− = 398 ≤ 400