Skip to content

fix(visualizer): make Deep Think a tri-state control so env reasoningEnabled is respected#2182

Merged
quanru merged 1 commit intomainfrom
fix/visualizer-deep-think-tri-state
Mar 19, 2026
Merged

fix(visualizer): make Deep Think a tri-state control so env reasoningEnabled is respected#2182
quanru merged 1 commit intomainfrom
fix/visualizer-deep-think-tri-state

Conversation

@quanru
Copy link
Copy Markdown
Collaborator

@quanru quanru commented Mar 19, 2026

Summary

  • The Playground Deep Think checkbox previously defaulted to false, which always overrode MIDSCENE_MODEL_REASONING_ENABLED from env config — users who set it to true still saw thinking=false in logs.
  • Changed Deep Think from a binary Checkbox to a tri-state Radio control (Auto / On / Off):
    • Auto (default): does not pass deepThink, so MIDSCENE_MODEL_REASONING_ENABLED env variable controls reasoning behavior. A tooltip on "Auto" explains this.
    • On: passes deepThink=true, force-enables reasoning.
    • Off: passes deepThink=false, force-disables reasoning.
  • Updated store type from boolean to boolean | 'unset', with proper localStorage persistence and restoration.

Test plan

  • Fresh Playground (no localStorage) + MIDSCENE_MODEL_REASONING_ENABLED=true → reasoning should be enabled (check ai-call.log)
  • Fresh Playground + MIDSCENE_MODEL_REASONING_ENABLED=false → reasoning should be disabled
  • Select "On" → reasoning force-enabled regardless of env
  • Select "Off" → reasoning force-disabled regardless of env
  • Select "Auto" → env variable controls reasoning
  • Hover over "Auto" radio → tooltip shows env variable name
  • Toggle flow: Auto → On → Off → Auto, refresh page, verify state persists correctly
  • Non-aiAct actions should never forward deepThink

…Enabled is respected

The Deep Think checkbox previously defaulted to false, which always
overrode MIDSCENE_MODEL_REASONING_ENABLED from env config. Changed to
a tri-state Radio (Auto/On/Off) where Auto means the env variable
controls reasoning behavior.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying midscene with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4d6215c
Status: ✅  Deploy successful!
Preview URL: https://39304175.midscene.pages.dev
Branch Preview URL: https://fix-visualizer-deep-think-tr.midscene.pages.dev

View logs

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d6215cc16

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +199 to +200
deepThink: boolean | 'unset';
setDeepThink: (deepThink: boolean | 'unset') => void;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Rebuild @midscene/visualizer dist for the new tri-state API

@midscene/visualizer is consumed through its published dist/* entrypoints (packages/visualizer/package.json points main/module/types there), but this commit only updates src/*. The checked-in build artifacts are still on the old boolean implementation (packages/visualizer/dist/lib/component/config-selector/index.js still renders a checkbox, and packages/visualizer/dist/types/store/store.d.ts still declares deepThink: boolean), so apps importing @midscene/visualizer such as packages/playground-app/src/PlaygroundApp.tsx and apps/report/src/components/playground/index.tsx will keep the pre-fix behavior until the package is rebuilt and the generated files are committed.

Useful? React with 👍 / 👎.

@quanru quanru merged commit 3690177 into main Mar 19, 2026
10 checks passed
@quanru quanru deleted the fix/visualizer-deep-think-tri-state branch March 19, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants