Repository navigation
feat(task): task-local runtime thinking effort state with per-request override (DTE series 2/5) #1523
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
64
commits into
Zoo-Code-Org:main
Choose a base branch
from
easonLiangWorldedtech:feat/dte-v2-3-task-runtime-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
feat(task): task-local runtime thinking effort state with per-request override (DTE series 2/5) #1523
Changes from all commits
Commits
Show all changes
64 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 4075c8a
feat(task): task-local runtime thinking effort state with per-request…
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 f97f8d9
Merge U2 head (18f488fa5) into U3 (stack sync: U1 final CR fixes + U2…
easonliang28 efbd336
Merge U1 final head (39762bf81) into U2 (stack sync: U1 last CR fix —…
easonliang28 c5b48aa
Merge U2 head (efbd336e5) into U3 (stack sync: U1 final persistence t…
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 e8c66cf
Merge U2 head (069c34b9a) into U3 (stack sync: main advances to 0dbd5…
easonliang28 1edd728
fix(task): clear DTE runtime-effort state on disposal and dispose abo…
easonliang28 1087fcb
fix(task): restore API configuration when clearing the DTE effort ove…
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
4f71c00
merge(upstream): take main into DTE unit 3
8fdade5
test(webview): drop two explicit-any casts the merge re-introduced
6aa3560
merge(upstream): redo the spec resolutions from the merge stages
72fd869
test(webview): close the test the conflict cut open
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
7c98c57
Merge upstream/main into feat/dte-v2-3-task-runtime-effort
d47e937
chore: re-run the e2e-mock restart scenario
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 22586f9
Merge upstream main into feat/dte-v2-3-task-runtime-effort
easonliang28 ea2577a
Drop the double blank line the merge left between describes
easonliang28 0287e7e
Make the invalid-timestamp delete assertion non-vacuous
easonliang28 1bbdab8
fix(settings): keep task-local thinking effort out of the profile pro…
easonliang28 66861d9
test(settings): regenerate experimental-settings visual baselines in …
easonliang28 f6e6a1e
chore(task): drop Stryker suppression comments per maintainer directive
easonliang28 eb6acd9
Merge Zoo-Code-Org main 4f1dee18e into dte-v2-3 (PR 1523)
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 58a0534
Merge feat/dte-v2-2-per-request-effort (post-main-sync head) into fea…
easonliang28 5aa123e
fix(task): clear the runtime effort override before handlers are coll…
19e8586
Merge remote-tracking branch 'upstream/main' into feat/dte-v2-3-task-…
easonLiangWorldedtech 8b40ef4
style: apply repo Prettier to the merge resolution
easonLiangWorldedtech 5937e21
chore(knip): mark the test-only view-identity seams @internal
easonLiangWorldedtech c7f5c49
chore: re-trigger CI after the Windows webview unhandled-error flake
easonLiangWorldedtech 5febf6a
Merge upstream/main into feat/dte-v2-3-task-runtime-effort
6bfd5ce
test(webview): give the experimental settings fixture the required ap…
easonLiangWorldedtech 4b737c5
merge upstream/main (a4f774b17) into feat/dte-v2-3-task-runtime-effort
easonLiangWorldedtech ec840f5
test(settings): pin the hidden dynamicThinkingEffort save test to a p…
easonLiangWorldedtech 36b9e5b
test(settings): type the hydrated settings-view state
easonLiangWorldedtech b1d2d58
test(webview): await the on-demand locale fetch instead of timing it
easonLiangWorldedtech b2b31f7
refactor(dte): drop the U5 reasoning pair and the duplicated U1 surface
easonLiangWorldedtech cf67a79
refactor(dte): keep only the task-runtime-effort unit in this PR
easonLiangWorldedtech 8144b12
fix(task): make runtime-effort updates disposal-aware and prove deliv…
easonLiangWorldedtech 60d3acd
test(condense): prove effort forwarding at the summarizer boundary
easonLiangWorldedtech aa9d962
Merge upstream/main (e943530c8) into feat/dte-v2-3-task-runtime-effort
easonLiangWorldedtech 79e1c24
fix(task): address the #1523 review round on the effort override
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
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
98 changes: 98 additions & 0 deletions
98
src/core/condense/__tests__/condense-effort-metadata.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,98 @@ | ||
| // npx vitest run src/core/condense/__tests__/condense-effort-metadata.spec.ts | ||
| // | ||
| // The summarizer boundary: Task hands the task-local thinking effort override to | ||
| // to summarizeConversation inside request metadata. This checks the other half of that hand-off: | ||
| // the real summarizer forwards the metadata to the handler's createMessage instead of dropping | ||
| // the effort. The Task-side tests cover Task-to-summarizer propagation only. | ||
|
|
||
| import { Anthropic } from "@anthropic-ai/sdk" | ||
| import type { ModelInfo, ReasoningEffortExtended } from "@roo-code/types" | ||
| import { TelemetryService } from "@roo-code/telemetry" | ||
|
|
||
| import type { ApiHandlerCreateMessageMetadata } from "../../../api" | ||
| import { BaseProvider } from "../../../api/providers/base-provider" | ||
| import { ApiStream, ApiStreamChunk } from "../../../api/transform/stream" | ||
| import { ApiMessage } from "../../task-persistence/apiMessages" | ||
| import { summarizeConversation } from "../index" | ||
|
|
||
| const OVERRIDE_EFFORT: ReasoningEffortExtended = "xhigh" | ||
| const TASK_ID = "dte-condense-task" | ||
|
|
||
| class RecordingApiHandler extends BaseProvider { | ||
| /** The metadata of the last request this handler was asked to make. */ | ||
| public requestedMetadata: ApiHandlerCreateMessageMetadata | undefined | ||
|
|
||
| override createMessage( | ||
| _systemPrompt: string, | ||
| _messages: Anthropic.Messages.MessageParam[], | ||
| metadata?: ApiHandlerCreateMessageMetadata, | ||
| ): ApiStream { | ||
| this.requestedMetadata = metadata | ||
| return (async function* (): AsyncGenerator<ApiStreamChunk> { | ||
| yield { type: "text", text: "summary of the conversation" } | ||
| yield { type: "usage", inputTokens: 10, outputTokens: 5, totalCost: 0.01 } | ||
| })() | ||
| } | ||
|
|
||
| override getModel(): { id: string; info: ModelInfo } { | ||
| return { | ||
| id: "dte-condense-model", | ||
| info: { contextWindow: 100_000, maxTokens: 5_000, supportsPromptCache: false, supportsImages: false }, | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Three messages with no summary in them: getMessagesSinceLastSummary returns all of them, so | ||
| // summarizeConversation gets past its "not enough messages" guard and issues the request. | ||
| function conversationHistory(): ApiMessage[] { | ||
| return [ | ||
| { role: "user", content: [{ type: "text", text: "read the failing test" }], ts: 1 }, | ||
| { role: "assistant", content: [{ type: "text", text: "the assertion drifted" }], ts: 2 }, | ||
| { role: "user", content: [{ type: "text", text: "fix it" }], ts: 3 }, | ||
| ] | ||
| } | ||
|
|
||
| describe("summarizeConversation reasoning-effort forwarding", () => { | ||
| beforeEach(() => { | ||
| if (!TelemetryService.hasInstance()) { | ||
| TelemetryService.createInstance([]) | ||
| } | ||
| }) | ||
|
|
||
| it("forwards an active override to the handler request", async () => { | ||
| const handler = new RecordingApiHandler() | ||
|
|
||
| const result = await summarizeConversation({ | ||
| messages: conversationHistory(), | ||
| apiHandler: handler, | ||
| systemPrompt: "system prompt", | ||
| taskId: TASK_ID, | ||
| isAutomaticTrigger: false, | ||
| metadata: { mode: "code", taskId: TASK_ID, reasoningEffort: OVERRIDE_EFFORT }, | ||
| environmentDetails: "environment details", | ||
| cwd: "/workspace", | ||
| }) | ||
|
|
||
| expect(result.error).toBeUndefined() | ||
| expect(result.summary).toBe("summary of the conversation") | ||
| expect(handler.requestedMetadata?.reasoningEffort).toBe(OVERRIDE_EFFORT) | ||
| }) | ||
|
|
||
| it("omits the key when the caller hands no override", async () => { | ||
| const handler = new RecordingApiHandler() | ||
|
|
||
| const result = await summarizeConversation({ | ||
| messages: conversationHistory(), | ||
| apiHandler: handler, | ||
| systemPrompt: "system prompt", | ||
| taskId: TASK_ID, | ||
| isAutomaticTrigger: false, | ||
| metadata: { mode: "code", taskId: TASK_ID }, | ||
| environmentDetails: "environment details", | ||
| cwd: "/workspace", | ||
| }) | ||
|
|
||
| expect(result.summary).toBe("summary of the conversation") | ||
| expect(handler.requestedMetadata).not.toHaveProperty("reasoningEffort") | ||
| }) | ||
| }) |
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.