-
Notifications
You must be signed in to change notification settings - Fork 269
feat(settings): dynamic thinking effort experimental toggle (DTE-1) #1521
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
6
commits into
Zoo-Code-Org:main
Choose a base branch
from
easonLiangWorldedtech:feat/dte-v2-1-dynamic-thinking-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
6 commits
Select commit
Hold shift + click to select a range
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 39762bf
test(settings): assert false and unset dynamicThinkingEffort persiste…
easonliang28 e89cced
Merge upstream main (0dbd5846f) into U1 (stack sync: main v3.82.0 - G…
easonliang28 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
| 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
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
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
28 changes: 28 additions & 0 deletions
28
webview-ui/src/components/settings/__tests__/ExperimentalSettings.visual.fixture.tsx
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,28 @@ | ||
| import { useState } from "react" | ||
|
|
||
| import type { Experiments } from "@roo-code/types" | ||
|
|
||
| import { EXPERIMENT_IDS, experimentDefault } from "@roo/experiments" | ||
|
|
||
| import { ExperimentalSettings } from "../ExperimentalSettings" | ||
| import { AppProviders } from "../../../../playwright/AppProviders" | ||
|
|
||
| export function ExperimentalSettingsStory() { | ||
| const [experiments, setExperiments] = useState<Experiments>({ | ||
| ...experimentDefault, | ||
| [EXPERIMENT_IDS.DYNAMIC_THINKING_EFFORT]: true, | ||
| }) | ||
|
|
||
| return ( | ||
| <AppProviders> | ||
| <div | ||
| data-testid="experimental-settings-story" | ||
| className="w-[488px] max-w-full rounded-lg border border-vscode-panel-border bg-vscode-editor-background p-4 text-vscode-editor-foreground"> | ||
| <ExperimentalSettings | ||
| experiments={experiments} | ||
| setExperimentEnabled={(id, enabled) => setExperiments((current) => ({ ...current, [id]: enabled }))} | ||
| /> | ||
| </div> | ||
| </AppProviders> | ||
| ) | ||
| } |
12 changes: 12 additions & 0 deletions
12
webview-ui/src/components/settings/__tests__/ExperimentalSettings.visual.tsx
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,12 @@ | ||
| import { expect, test } from "../../../../playwright/coverage-fixture" | ||
| import { mountedStory } from "../../../../playwright/mounted-story" | ||
| import { applyVisualTheme, visualThemes } from "../../../../playwright/themes" | ||
|
|
||
| for (const theme of visualThemes) { | ||
| test(`renders the experimental settings section in the VS Code ${theme.name} theme`, async ({ mount, page }) => { | ||
| const component = mountedStory(await mount("experimental-settings")) | ||
| await applyVisualTheme(page, theme) | ||
| const story = component.getByTestId("experimental-settings-story") | ||
| await expect(story).toHaveScreenshot(`experimental-settings-${theme.name}.png`) | ||
| }) | ||
| } |
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.