feat(agents): expose thinking variant configuration in agent settings (#1715)

* feat(agents): expose thinking variant configuration in agent settings

Fix #1425: add variant field to agent config UI so users can configure
thinking/reasoning depth per agent without editing opencode.json.

Changes:
- Added variant to AgentConfig and AgentDraft types in useAgentsStore
- Pass variant in createAgent and updateAgent API calls
- Support null for temperature, top_p, and variant to clear overrides
- Added variant input field in AgentsPage 'Model & Parameters' section
- Added variant to settings search registry
- Added i18n strings for variant field in all 8 non-English locales

The variant field maps to provider-specific parameters (e.g. Anthropic
high/max variant, OpenAI reasoning effort). Users can enter any string
value; the SDK passes it through to the model provider.

Clearing temperature/topP/variant now sends null to the server instead
of omitting the field, which properly removes the override in
opencode.json.

* fix(sync): preserve tool state.time in materialization merge

* chore: trigger re-review

* fix(agents): use thinking variant selector in settings

* fix(agents): preserve thinking variant values

---------

Co-authored-by: Leonid Skorobogatyy <bash@opencode.itc.local>
This commit is contained in:
bashrusakh
2026-06-23 23:22:59 +03:00
committed by GitHub
co-authored by Leonid Skorobogatyy
parent 3d3674d4dd
commit e44efa97d6
13 changed files with 155 additions and 2 deletions
+4
View File
@@ -104,6 +104,7 @@ export interface AgentConfig {
name: string;
description?: string;
model?: string | null;
variant?: string | null;
temperature?: number;
top_p?: number;
prompt?: string | null;
@@ -170,6 +171,7 @@ export interface AgentDraft {
scope: AgentScope;
description?: string;
model?: string | null;
variant?: string;
temperature?: number;
top_p?: number;
prompt?: string;
@@ -331,6 +333,7 @@ export const useAgentsStore = create<AgentsStore>()(
if (config.description) agentConfig.description = config.description;
if (config.model) agentConfig.model = config.model;
if (config.variant) agentConfig.variant = config.variant;
if (config.temperature !== undefined) agentConfig.temperature = config.temperature;
if (config.top_p !== undefined) agentConfig.top_p = config.top_p;
if (config.prompt) agentConfig.prompt = config.prompt;
@@ -395,6 +398,7 @@ export const useAgentsStore = create<AgentsStore>()(
if (config.mode !== undefined) agentConfig.mode = config.mode;
if (config.description !== undefined) agentConfig.description = config.description;
if (config.model !== undefined) agentConfig.model = config.model;
if ('variant' in config) agentConfig.variant = config.variant ?? null;
if (config.temperature !== undefined) agentConfig.temperature = config.temperature;
if (config.top_p !== undefined) agentConfig.top_p = config.top_p;
if (config.prompt !== undefined) agentConfig.prompt = config.prompt;