GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(opencode): show Reasoning selector for OpenCode models (#9287) · pingdotgg/t3code@dbc7bfa

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps
    • server/src/provider/Layers
      • OpenCodeProvider.ts
    • web/src/components/chat
      • TraitsPicker.test.ts
      • TraitsPicker.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/provider/Layers/OpenCodeProvider.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/provider/Layers/OpenCodeProvider.ts
+33-3Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,45 @@ function inferDefaultAgent(agents: ReadonlyArray<Agent>): string | undefined {
171171
}
172172

173173
const DEFAULT_OPENCODE_MODEL_CAPABILITIES: ModelCapabilities = createModelCapabilities({
174-
optionDescriptors: [],
174+
optionDescriptors: [
175+
{
176+
id: "variant",
177+
label: "Reasoning",
178+
type: "select",
179+
options: [
180+
{ id: "low", label: "Low" },
181+
{ id: "medium", label: "Medium", isDefault: true },
182+
{ id: "high", label: "High" },
183+
{ id: "xhigh", label: "Extra High" },
184+
],
185+
currentValue: "medium",
186+
},
187+
{
188+
id: "agent",
189+
label: "Agent",
190+
type: "select",
191+
options: [
192+
{ id: "build", label: "Build", isDefault: true },
193+
{ id: "plan", label: "Plan" },
194+
],
195+
currentValue: "build",
196+
},
197+
],
175198
});
176199

177200
function openCodeCapabilitiesForModel(input: {
178201
readonly providerID: string;
179202
readonly model: ProviderListResponse["all"][number]["models"][string];
180203
readonly agents: ReadonlyArray<Agent>;
181204
}): ModelCapabilities {
182-
const variantValues = Object.keys(input.model.variants ?? {});
205+
const rawVariantValues = Object.keys(input.model.variants ?? {});
206+
// When a model advertises no variants, synthesize the standard reasoning
207+
// levels so the composer still offers a Reasoning selector (mirrors the
208+
// Codex/Grok experience where reasoning is always configurable). The set
209+
// covers the common OpenCode variant spectrum; `inferDefaultVariant`
210+
// picks the provider-appropriate default (e.g. medium for openai/opencode).
211+
const variantValues =
212+
rawVariantValues.length > 0 ? rawVariantValues : ["low", "medium", "high", "xhigh"];
183213
const defaultVariant = inferDefaultVariant(input.providerID, variantValues);
184214
const variantOptions = variantValues.map((value) =>
185215
defaultVariant === value
@@ -201,7 +231,7 @@ function openCodeCapabilitiesForModel(input: {
201231
? [
202232
{
203233
id: "variant",
204-
label: "Variant",
234+
label: "Reasoning",
205235
type: "select" as const,
206236
options: variantOptions,
207237
...(defaultVariant ? { currentValue: defaultVariant } : {}),
Collapse file

‎apps/web/src/components/chat/TraitsPicker.test.ts‎

Copy file name to clipboardExpand all lines: apps/web/src/components/chat/TraitsPicker.test.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ describe("buildUnavailableModelOptionDescriptors", () => {
167167
).toEqual([
168168
{
169169
id: "variant",
170-
label: "Variant",
170+
label: "Reasoning",
171171
type: "select",
172172
options: [{ id: "max", label: "max" }],
173173
currentValue: "max",
Collapse file

‎apps/web/src/components/chat/TraitsPicker.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/chat/TraitsPicker.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const SAVED_OPTION_LABELS: Readonly<Record<string, string>> = {
4040
agent: "Agent",
4141
effort: "Effort",
4242
reasoningEffort: "Reasoning effort",
43-
variant: "Variant",
43+
variant: "Reasoning",
4444
};
4545

4646
function savedOptionLabel(id: string): string {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.