Skip to content

feat: add reasoning effort picker to session screen (#47)#51

Open
dzianisv wants to merge 2 commits into
mainfrom
feat/issue-47-reasoning-effort
Open

feat: add reasoning effort picker to session screen (#47)#51
dzianisv wants to merge 2 commits into
mainfrom
feat/issue-47-reasoning-effort

Conversation

@dzianisv

Copy link
Copy Markdown
Owner

Summary

Closes #47

Adds a reasoning effort selector to the session/chat screen alongside the existing model picker.

What changed

File Change
src/lib/sdk.ts Added variants to provider model type
src/stores/catalog.ts Added variants to ProviderModel, added variant/setVariant to catalog state, reset variant on model change
src/stores/sessions.ts Added variant param to sendMessage, passed to sdk.session.prompt()
src/components/chat/VariantPicker.tsx New BottomSheet component — auto/low/medium/high options
src/components/chat/index.ts Export VariantPicker
app/session/[id].tsx Added reasoning chip to toolbar + VariantPicker bottom sheet

API field used

variant in POST /session/:sessionID/prompt_async.

The opencode server maps the variant name to the model's configured reasoningEffort value (e.g. variant: "high"{ reasoningEffort: "high" }). Models expose their supported variants via the /provider endpoint.

UX

  • Reasoning chip appears in the toolbar only when the current model has variants (e.g. gemini-2.5-pro, gpt-5.2-chat)
  • Chip shows ⚡ icon + current selection (defaults to "Auto")
  • Active selection is highlighted in purple
  • Tapping opens a BottomSheet picker consistent with the ModelPicker pattern
  • Variant resets to Auto when model changes

dzianisv added 2 commits June 24, 2026 06:02
- New Session modal now shows:
  - Current project as tappable row (tap to create session immediately)
  - Recent Projects section: list of previously used dirs as tappable rows
  - Server Projects section: projects known to opencode server (from /project API)
  - Manual path input as fallback (unchanged behavior)
- Modal body is now scrollable to handle long lists
- All selection paths call addRecentDirectory to keep recents up to date
- TypeScript clean (pre-existing VariantPicker.tsx error unrelated)
- Add VariantPicker bottom sheet component (low/medium/high/auto)
- Add variant state to catalog store, reset on model change
- Pass variant through sendMessage -> sdk.session.prompt()
- Add reasoning chip to toolbar, shown only for models with variants
- Parse model.variants from provider API response in catalog and sdk types

API field: variant in POST /session/:id/prompt_async
Server maps variant -> reasoningEffort via model variant config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to change the model reasoning effort

1 participant