Skip to content

feat(desktop/cli): add expand_thinking config toggle and persist /verbose (#3303 #3312)#3396

Open
ashishexee wants to merge 1 commit into
esengine:main-v2from
ashishexee:feat/3303-expand-thinking-default
Open

feat(desktop/cli): add expand_thinking config toggle and persist /verbose (#3303 #3312)#3396
ashishexee wants to merge 1 commit into
esengine:main-v2from
ashishexee:feat/3303-expand-thinking-default

Conversation

@ashishexee

@ashishexee ashishexee commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Closes #3303
Closes #3312

Problem

#3303 — Every AI response that includes reasoning shows a collapsible "thinking" section in the desktop app. It was hardcoded to collapsed — useState(false) in Message.tsx. Users who always want to see the reasoning had to click expand every single time, on every single message.

#3312 — The /verbose toggle (Ctrl+O) resets on every CLI session. Users who prefer seeing reasoning text must re-toggle it each time they start a chat.

Solution

#3303 — Adds a [desktop].expand_thinking config option that controls the default expand/collapse state of the reasoning section. Collapsed by default (no behavior change for existing users).

#3312 — Adds a [ui].show_reasoning config option. The /verbose toggle now persists across sessions by writing to config.

Changes

#3303 — Desktop expand_thinking toggle

Go (config layer)

  • DesktopConfig.ExpandThinking — bool field with TOML tag expand_thinking, default false
  • Config.SetExpandThinking(bool) — mutator in edit.go, follows the same pattern as SetDesktopCloseBehavior
  • render.go — TOML output includes expand_thinking with inline comment

Go (desktop bridge)

  • SettingsView.ExpandThinking — bool JSON field, populated from config in Settings()
  • App.SetExpandThinking(bool) — Wails-bound method, writes via applyConfigOnly (no controller rebuild — display-only setting)

Frontend (types + bridge)

  • SettingsView in types.ts — added expandThinking: boolean
  • AppBindings in bridge.ts — added SetExpandThinking(on: boolean): Promise<void>
  • Mock implementation in bridge.ts for browser dev mode

Frontend (UI)

  • AssistantMessage in Message.tsx — accepts defaultExpanded prop → ProcessCard defaultOpen={item.streaming || defaultExpanded}
  • Transcript.tsx — threads defaultExpandThinking through hot/warm/cold zones (LiveAssistantMessage, WarmZone, WarmTurnItems)
  • App.tsx — fetches setting on startup, stores in expandThinking state, passes to Transcript
  • SettingsPanel.tsx — two-button segmented control using <SettingsField> in General tab ("Collapsed" / "Expanded")

i18n

  • en.ts — "settings.expandThinking", "settings.expandThinking.expanded", "settings.expandThinking.collapsed"
  • zh.ts — "思考过程显示", "默认展开", "默认折叠"

#3312 — CLI /verbose persistence

Go (config layer)

  • UIConfig.ShowReasoning — bool field with TOML tag show_reasoning, default false
  • Config.SetShowReasoning(bool) — mutator in edit.go
  • render.go — TOML output for [ui] section

Go (CLI)

  • chat_tui.gocfg *config.Config field, toggleVerboseReasoning now calls cfg.SetShowReasoning + cfg.Save()
  • cli.go — init showReasoning from config on startup
  • help_view.go — added /verbose to builtinHelpItems()

Config example

[ui]
show_reasoning = true   # CLI: show thinking text by default; false = collapsed (toggle with Ctrl+O)

[desktop]
expand_thinking = true   # show reasoning text expanded by default; false = collapsed

Behavior notes

  • ProcessCard defaultOpen={item.streaming || defaultExpanded} — streaming messages always open; non-streaming messages respect the setting on mount
  • History panel preview stays collapsed (doesn't pass defaultExpandThinking)
  • Desktop setting does not affect CLI; CLI setting does not affect desktop

Testing

  • go test ./internal/... — passes
  • go vet ./internal/... — clean
  • gofmt -l — clean on all changed Go files
  • go test -race ./internal/config/... ./internal/cli/... — clean

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) config Configuration & setup (internal/config) tui Terminal UI / CLI (internal/cli, internal/control) and removed v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 6, 2026
@ashishexee

ashishexee commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

@esengine @SivanCola can you take a look at this I have pushed the changes for 3 issues
#3303 #3312
edit: made a seperate pr for #3316 /sandbox

@ashishexee ashishexee force-pushed the feat/3303-expand-thinking-default branch from dea52a7 to 035af29 Compare June 7, 2026 12:29

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The expand_thinking work itself looks good — config field, mutator following the SetDesktopCloseBehavior pattern, and the Message.tsx default wiring are all clean.

One thing before merge: this PR bundles three independent changes under a title that only mentions #3303:

  1. expand_thinking default toggle (#3303) — the stated change
  2. /verbose persistence via UI.ShowReasoning
  3. a brand-new /sandbox status command (closes #3316)

The /sandbox command (#3316) is unrelated to thinking-section display and pulls in the sandbox package + new slash command, help, and completion entries. Bundling two separately-tracked issues makes the history harder to revert and review.

Please split /sandbox (#3316) into its own PR. This one can keep #3303 plus the /verbose persistence (both about reasoning display, so they belong together). Once split, I'll merge this promptly.

@ashishexee

Copy link
Copy Markdown
Contributor Author

seems like a good idea let me do it after that we can merge

@ashishexee ashishexee force-pushed the feat/3303-expand-thinking-default branch from 035af29 to 6388762 Compare June 8, 2026 11:31
@ashishexee ashishexee changed the title feat(desktop): add expand_thinking config toggle (#3303) feat(desktop): add expand_thinking config toggle and persist /verbose (#3303 #3312) Jun 8, 2026
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 8, 2026
@ashishexee ashishexee requested a review from esengine June 8, 2026 12:08
@ashishexee ashishexee changed the title feat(desktop): add expand_thinking config toggle and persist /verbose (#3303 #3312) feat(desktop/cli): add expand_thinking config toggle and persist /verbose (#3303 #3312) Jun 8, 2026

@ashishexee ashishexee left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Split /sandbox (#3316) into its own PR as requested.
This PR now only covers #3303 + #3312 — both reasoning-display changes. Force-pushed as a single clean commit. Ready for re-review.

Also persists /verbose toggle across CLI sessions (esengine#3312).

Closes esengine#3303
Closes esengine#3312
@ashishexee ashishexee force-pushed the feat/3303-expand-thinking-default branch from 6388762 to fa4144d Compare June 8, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/verbose: toggle state not persisted across CLI sessions [Feature]: 默认展开 / 折叠思考过程的开关

2 participants