From 48cd5b68d25eac4390dcb86c0a5e28e8a6036748 Mon Sep 17 00:00:00 2001 From: UniDesk Codex Date: Tue, 30 Jun 2026 12:51:37 +0800 Subject: [PATCH] fix: disable opencode dsflash reasoning by default --- scripts/gitops-render.mjs | 14 ++++++++++++-- scripts/gitops-render.test.ts | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/gitops-render.mjs b/scripts/gitops-render.mjs index 3c892960..c3787ac3 100644 --- a/scripts/gitops-render.mjs +++ b/scripts/gitops-render.mjs @@ -5645,6 +5645,8 @@ function opencodeRuntimeConfigForProfile(deploy, profile) { const apiKeyEnv = configString(config.apiKeyEnv) || opencodeApiKeyEnvName(providerId); const contextLimit = opencodePositiveInteger(config.contextLimit, 1000000, `deploy.lanes.${profile}.opencode.contextLimit`); const outputLimit = opencodePositiveInteger(config.outputLimit, 384000, `deploy.lanes.${profile}.opencode.outputLimit`); + const reasoning = opencodeConfigBoolean(config.reasoning, false, `deploy.lanes.${profile}.opencode.reasoning`); + const toolCall = opencodeConfigBoolean(config.toolCall, true, `deploy.lanes.${profile}.opencode.toolCall`); const upstreamBaseURL = configString(config.upstreamBaseURL) || configString(config.baseURL) || "https://opencode.ai/zen/go/v1"; const providerProxyPort = opencodePositiveInteger(config.providerProxyPort, 4097, `deploy.lanes.${profile}.opencode.providerProxyPort`); const providerProxyBasePath = configString(config.providerProxyBasePath) || "/v1"; @@ -5665,6 +5667,8 @@ function opencodeRuntimeConfigForProfile(deploy, profile) { apiKeySecretRef: configString(config.apiKeySecretRef) || "hwlab-code-agent-provider/opencode-api-key", contextLimit, outputLimit, + reasoning, + toolCall, agentrunSecretNamespace: configString(config.agentrunSecretNamespace) || "agentrun-v02", agentrunSecretName: configString(config.agentrunSecretName) || `agentrun-v01-provider-${providerProfile}`, agentrunSecretKeys: Array.isArray(config.agentrunSecretKeys) && config.agentrunSecretKeys.length > 0 @@ -5679,6 +5683,12 @@ function opencodePositiveInteger(value, fallback, label) { return value; } +function opencodeConfigBoolean(value, fallback, label) { + if (value === undefined || value === null) return fallback; + assert.equal(typeof value, "boolean", `${label} must be a boolean`); + return value; +} + function opencodeEgressProxyUrlForProfile(deploy, profile) { const proxy = deploy?.lanes?.[profile]?.gitMirror?.egressProxy; if (!proxy || proxy.required === false) return ""; @@ -5723,8 +5733,8 @@ function opencodeConfigContent(config) { models: { [config.model]: { name: config.model, - reasoning: true, - tool_call: true, + reasoning: config.reasoning, + tool_call: config.toolCall, limit: { context: config.contextLimit, output: config.outputLimit diff --git a/scripts/gitops-render.test.ts b/scripts/gitops-render.test.ts index 2203888d..287dfc64 100644 --- a/scripts/gitops-render.test.ts +++ b/scripts/gitops-render.test.ts @@ -774,6 +774,8 @@ test("v03 render includes D518 secret-plane smoke on D518 gitops root", async () assert.equal(opencodeConfig.provider["dsflash-go"].npm, "@ai-sdk/openai-compatible"); assert.equal(opencodeConfig.provider["dsflash-go"].options.baseURL, "http://127.0.0.1:4097/v1"); assert.equal(opencodeConfig.provider["dsflash-go"].options.apiKey, "{env:OPENCODE_DSFLASH_GO_API_KEY}"); + assert.equal(opencodeConfig.provider["dsflash-go"].models["deepseek-v4-flash"].reasoning, false); + assert.equal(opencodeConfig.provider["dsflash-go"].models["deepseek-v4-flash"].tool_call, true); assert.deepEqual(opencodeConfig.provider["dsflash-go"].models["deepseek-v4-flash"].limit, { context: 1000000, output: 384000 }); const providerProxy = collectContainersFromItem(opencodeDeployment).find((container) => container.name === "opencode-provider-proxy"); assert.ok(providerProxy, "expected provider proxy sidecar");