feat: add ofcx-go code agent profile and Moon Bridge OpenCode route
- Add ofcx-go to backendProfiles allowlist in agentrun-dispatch.mjs - Extend deepseek-proxy Moon Bridge config with opencode provider - Add deepseek-v4-flash model and opencode route to Moon Bridge config - Add OPENCODE_API_KEY env var injection from hwlab-v02-code-agent-provider Secret - Support both deepseek and opencode providers in shared Moon Bridge instance
This commit is contained in:
@@ -97,7 +97,7 @@ export const AGENTRUN_REUSABLE_CREDENTIAL_ENV_NAMES = Object.freeze([
|
|||||||
"UNIDESK_SSH_CLIENT_TOKEN"
|
"UNIDESK_SSH_CLIENT_TOKEN"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const backendProfiles = Object.freeze(["codex", "deepseek", "minimax-m3"]);
|
const backendProfiles = Object.freeze(["codex", "deepseek", "minimax-m3", "ofcx-go"]);
|
||||||
const providerSecretKeys = Object.freeze(["auth.json", "config.toml"]);
|
const providerSecretKeys = Object.freeze(["auth.json", "config.toml"]);
|
||||||
const reusableCredentialEnvNameSet = new Set(AGENTRUN_REUSABLE_CREDENTIAL_ENV_NAMES);
|
const reusableCredentialEnvNameSet = new Set(AGENTRUN_REUSABLE_CREDENTIAL_ENV_NAMES);
|
||||||
|
|
||||||
|
|||||||
@@ -4113,7 +4113,10 @@ function deepSeekProxyManifest({ profile = "dev", source, registryPrefix = defau
|
|||||||
image: bridgeImage,
|
image: bridgeImage,
|
||||||
imagePullPolicy: "IfNotPresent",
|
imagePullPolicy: "IfNotPresent",
|
||||||
command: ["/bin/sh", "-eu", "/scripts/render-config.sh"],
|
command: ["/bin/sh", "-eu", "/scripts/render-config.sh"],
|
||||||
env: [{ name: "DEEPSEEK_API_KEY", valueFrom: { secretKeyRef: { name: secretNameForProfile("hwlab-code-agent-provider", profile), key: "openai-api-key", optional: true } } }],
|
env: [
|
||||||
|
{ name: "DEEPSEEK_API_KEY", valueFrom: { secretKeyRef: { name: secretNameForProfile("hwlab-code-agent-provider", profile), key: "openai-api-key", optional: true } } },
|
||||||
|
{ name: "OPENCODE_API_KEY", valueFrom: { secretKeyRef: { name: secretNameForProfile("hwlab-code-agent-provider", profile), key: "opencode-api-key", optional: true } } }
|
||||||
|
],
|
||||||
volumeMounts: [
|
volumeMounts: [
|
||||||
{ name: "moonbridge-scripts", mountPath: "/scripts", readOnly: true },
|
{ name: "moonbridge-scripts", mountPath: "/scripts", readOnly: true },
|
||||||
{ name: "moonbridge-config", mountPath: "/config" }
|
{ name: "moonbridge-config", mountPath: "/config" }
|
||||||
@@ -4170,8 +4173,8 @@ function deepSeekProxyManifest({ profile = "dev", source, registryPrefix = defau
|
|||||||
|
|
||||||
function moonBridgeConfigRenderScript() {
|
function moonBridgeConfigRenderScript() {
|
||||||
return `#!/bin/sh
|
return `#!/bin/sh
|
||||||
if [ -z "\${DEEPSEEK_API_KEY:-}" ]; then
|
if [ -z "\${DEEPSEEK_API_KEY:-}" ] && [ -z "\${OPENCODE_API_KEY:-}" ]; then
|
||||||
echo "DEEPSEEK_API_KEY is required" >&2
|
echo "at least one of DEEPSEEK_API_KEY or OPENCODE_API_KEY is required" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
cat > /config/config.yml <<EOF
|
cat > /config/config.yml <<EOF
|
||||||
@@ -4228,6 +4231,22 @@ models:
|
|||||||
extensions:
|
extensions:
|
||||||
deepseek_v4:
|
deepseek_v4:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
deepseek-v4-flash:
|
||||||
|
context_window: 1000000
|
||||||
|
max_output_tokens: 384000
|
||||||
|
display_name: "DeepSeek V4 Flash via OpenCode Zen Go"
|
||||||
|
description: "DeepSeek V4 Flash through OpenCode Zen Go Chat Completions via Moon Bridge"
|
||||||
|
default_reasoning_level: "xhigh"
|
||||||
|
supported_reasoning_levels:
|
||||||
|
- effort: "high"
|
||||||
|
description: "High reasoning effort"
|
||||||
|
- effort: "xhigh"
|
||||||
|
description: "Maximum reasoning effort"
|
||||||
|
supports_reasoning_summaries: true
|
||||||
|
default_reasoning_summary: "auto"
|
||||||
|
extensions:
|
||||||
|
deepseek_v4:
|
||||||
|
enabled: true
|
||||||
providers:
|
providers:
|
||||||
deepseek:
|
deepseek:
|
||||||
base_url: "https://api.deepseek.com/anthropic"
|
base_url: "https://api.deepseek.com/anthropic"
|
||||||
@@ -4236,10 +4255,22 @@ providers:
|
|||||||
user_agent: "moonbridge/1.0"
|
user_agent: "moonbridge/1.0"
|
||||||
offers:
|
offers:
|
||||||
- model: ${deepSeekProfileModel}
|
- model: ${deepSeekProfileModel}
|
||||||
|
opencode:
|
||||||
|
base_url: "https://opencode.ai/zen/go/v1"
|
||||||
|
api_key: "\${OPENCODE_API_KEY:-}"
|
||||||
|
protocol: "openai-chat"
|
||||||
|
user_agent: "moonbridge-ofcx-go/1.0"
|
||||||
|
web_search:
|
||||||
|
support: "disabled"
|
||||||
|
offers:
|
||||||
|
- model: deepseek-v4-flash
|
||||||
routes:
|
routes:
|
||||||
${deepSeekProfileModel}:
|
${deepSeekProfileModel}:
|
||||||
model: ${deepSeekProfileModel}
|
model: ${deepSeekProfileModel}
|
||||||
provider: deepseek
|
provider: deepseek
|
||||||
|
deepseek-v4-flash:
|
||||||
|
model: deepseek-v4-flash
|
||||||
|
provider: opencode
|
||||||
EOF
|
EOF
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user