Repository navigation
feat(api): per-request thinking effort override and adaptive effort envelope (DTE series 2/5) #1522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
easonLiangWorldedtech
wants to merge
32
commits into
Zoo-Code-Org:main
Choose a base branch
from
easonLiangWorldedtech:feat/dte-v2-2-per-request-effort
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
19788c0
feat(settings): dynamic thinking effort experimental toggle (DTE-1)
easonliang28 82358bd
feat(api): per-request thinking effort override and adaptive effort e…
easonliang28 710bf61
feat(settings): dynamic thinking effort experimental toggle (DTE-1)
easonliang28 521e0e6
feat(settings): dynamic thinking effort experimental toggle (DTE-1)
easonliang28 e2f249a
Merge branch 'main' into feat/dte-v2-1-dynamic-thinking-effort
easonLiangWorldedtech 53f22dc
Merge upstream main (0d937c05081) into feat/dte-v2-1-dynamic-thinking…
easonliang28 18f488f
Merge feat/dte-v2-1-dynamic-thinking-effort (53f22dc) into feat/dte-v…
easonliang28 39762bf
test(settings): assert false and unset dynamicThinkingEffort persiste…
easonliang28 efbd336
Merge U1 final head (39762bf81) into U2 (stack sync: U1 last CR fix —…
easonliang28 e89cced
Merge upstream main (0dbd5846f) into U1 (stack sync: main v3.82.0 - G…
easonliang28 069c34b
Merge U1 head (e89cceddd9a) into U2 (stack sync: U1 final head in - m…
easonliang28 9bdc3c4
Merge remote-tracking branch 'upstream/main' into feat/dte-v2-2-per-r…
810caf1
chore: trigger label reconcile (CI green + CR approved, cron stalled)
2d8feeb
Merge commit 'refs/shapes/upstream-main' into feat/dte-v2-2-per-reque…
77ce7d2
Merge upstream main (3859e5dd8) into feat/dte-v2-2-per-request-effort
e776028
Retrigger CI: mutation-diff job failed on harness errors, not mutants
107649b
Drop the Windows related-test discovery workaround
331078f
merge(upstream): take main into the per-request effort unit
9189386
merge(upstream): take main into DTE unit 1
c95c510
test(webview): assert the two different outcomes for invalid delete t…
48ef159
Merge upstream/main into feat/dte-v2-2-per-request-effort
7e4c79d
Merge upstream/main into feat/dte-v2-2-per-request-effort
8fc8d1e
Merge upstream/main into feat/dte-v2-1-dynamic-thinking-effort
01a111e
test(settings): restore the blanket auto-deny specs to their upstream…
5ebf096
Merge upstream main into feat/dte-v2-2-per-request-effort
easonliang28 0287e7e
Make the invalid-timestamp delete assertion non-vacuous
easonliang28 bd914cf
Merge upstream/main into feat/dte-v2-1-dynamic-thinking-effort
easonliang28 02d56ec
Merge feat/dte-v2-1-dynamic-thinking-effort (post-main-sync head) int…
easonliang28 3109dcd
style(webview): drop the duplicated blank line the merge left between…
easonliang28 a556b05
Merge remote-tracking branch 'upstream/main' into feat/dte-v2-2-per-r…
easonLiangWorldedtech 7d8a620
style: apply repo Prettier to the merge resolution
easonLiangWorldedtech 87041c0
chore(knip): mark the test-only view-identity seams @internal
easonLiangWorldedtech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { experimentIds, experimentIdsSchema, experimentsSchema } from "../experiment.js" | ||
|
|
||
| describe("dynamicThinkingEffort experiment", () => { | ||
| it("is part of the experiment id enum", () => { | ||
| expect(experimentIds).toContain("dynamicThinkingEffort") | ||
| expect(experimentIdsSchema.safeParse("dynamicThinkingEffort").success).toBe(true) | ||
| }) | ||
|
|
||
| it("parses enabled and disabled states", () => { | ||
| expect(experimentsSchema.parse({ dynamicThinkingEffort: true })).toEqual({ dynamicThinkingEffort: true }) | ||
| expect(experimentsSchema.parse({ dynamicThinkingEffort: false })).toEqual({ dynamicThinkingEffort: false }) | ||
| expect(experimentsSchema.parse({})).toEqual({}) | ||
| }) | ||
|
|
||
| it("rejects non-boolean values", () => { | ||
| expect(experimentsSchema.safeParse({ dynamicThinkingEffort: "yes" }).success).toBe(false) | ||
| expect(experimentIdsSchema.safeParse("dynamic-thinking-effort").success).toBe(false) | ||
| }) | ||
| }) |
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
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
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
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
58 changes: 58 additions & 0 deletions
58
src/api/transform/__tests__/dte-effective-reasoning-effort.spec.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| // npx vitest run src/api/transform/__tests__/dte-effective-reasoning-effort.spec.ts | ||
|
|
||
| import { ADAPTIVE_OUTPUT_CONFIG_EFFORTS, resolveEffectiveReasoningEffort } from "../reasoning" | ||
|
|
||
| describe("DTE series 2/5 — resolveEffectiveReasoningEffort", () => { | ||
| const settingsEffort = "high" | ||
| const modelDefault = "medium" | ||
|
|
||
| it("returns the per-request override when present (strongest precedence)", () => { | ||
| expect( | ||
| resolveEffectiveReasoningEffort({ | ||
| override: "xhigh", | ||
| settingsReasoningEffort: settingsEffort, | ||
| modelDefaultEffort: modelDefault, | ||
| }), | ||
| ).toBe("xhigh") | ||
| }) | ||
|
|
||
| it("lets the override win even when it is out-of-range for the adaptive envelope", () => { | ||
| // "minimal" is a valid override value but outside the adaptive envelope set; | ||
| // resolution still returns it — envelope gating is the caller's concern. | ||
| expect( | ||
| resolveEffectiveReasoningEffort({ | ||
| override: "minimal", | ||
| settingsReasoningEffort: settingsEffort, | ||
| modelDefaultEffort: modelDefault, | ||
| }), | ||
| ).toBe("minimal") | ||
| }) | ||
|
|
||
| it("falls back to the settings value when no override is present", () => { | ||
| expect( | ||
| resolveEffectiveReasoningEffort({ settingsReasoningEffort: "low", modelDefaultEffort: modelDefault }), | ||
| ).toBe("low") | ||
| }) | ||
|
|
||
| it("preserves the settings 'disable' sentinel when no override is present", () => { | ||
| expect( | ||
| resolveEffectiveReasoningEffort({ settingsReasoningEffort: "disable", modelDefaultEffort: modelDefault }), | ||
| ).toBe("disable") | ||
| }) | ||
|
|
||
| it("an explicit override wins over a settings 'disable' sentinel", () => { | ||
| expect(resolveEffectiveReasoningEffort({ override: "low", settingsReasoningEffort: "disable" })).toBe("low") | ||
| }) | ||
|
|
||
| it("falls back to the model default when neither override nor settings is set", () => { | ||
| expect(resolveEffectiveReasoningEffort({ modelDefaultEffort: "low" })).toBe("low") | ||
| }) | ||
|
|
||
| it("returns undefined when nothing is set", () => { | ||
| expect(resolveEffectiveReasoningEffort({})).toBeUndefined() | ||
| }) | ||
|
|
||
| it("exposes exactly the in-range adaptive envelope efforts", () => { | ||
| expect([...ADAPTIVE_OUTPUT_CONFIG_EFFORTS]).toEqual(["low", "medium", "high", "xhigh", "max"]) | ||
| }) | ||
| }) |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.