feat: 全面清除用户/AI可见的 opencode 痕迹
Some checks failed
compliance-close / close-non-compliant (push) Has been cancelled
beta / sync (push) Has been cancelled

- system.ts 不再把真实 model id 喂给 LLM(修复"底层是opencode/big-pickle")
- TUI 首页 tips、窗口标题、ACP 弹窗、命令提示文案全部 → zmo
- config schema URL → zmo.dev;配置路径提示 → ~/.config/zmo、.zmo/
- 发给各家 LLM API 的标识头(X-Title/Referer/Source/UA/originator)→ zmo
- 保留:opencode provider 路由id、@opencode-ai 包名、opencode.json/OPENCODE_* 兼容

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 17:49:47 +08:00
parent 9970e6c1ad
commit 5bd92a3535
21 changed files with 81 additions and 82 deletions

View File

@@ -435,9 +435,9 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
autoload: false,
options: {
headers: {
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"X-Source": "opencode",
"HTTP-Referer": "https://github.com/helpLogin/zmo-cli",
"X-Title": "zmo",
"X-Source": "zmo",
},
},
}),
@@ -446,8 +446,8 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
autoload: false,
options: {
headers: {
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"HTTP-Referer": "https://github.com/helpLogin/zmo-cli",
"X-Title": "zmo",
},
},
}),
@@ -456,9 +456,9 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
autoload: provider.source === "config",
options: {
headers: {
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"X-BILLING-INVOKE-ORIGIN": "OpenCode",
"HTTP-Referer": "https://github.com/helpLogin/zmo-cli",
"X-Title": "zmo",
"X-BILLING-INVOKE-ORIGIN": "zmo",
},
},
}),
@@ -467,8 +467,8 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
autoload: false,
options: {
headers: {
"http-referer": "https://opencode.ai/",
"x-title": "opencode",
"http-referer": "https://github.com/helpLogin/zmo-cli",
"x-title": "zmo",
},
},
}),
@@ -573,8 +573,8 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
autoload: false,
options: {
headers: {
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"HTTP-Referer": "https://github.com/helpLogin/zmo-cli",
"X-Title": "zmo",
},
},
}),
@@ -595,7 +595,7 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
const directory = yield* InstanceState.directory
const aiGatewayHeaders = {
"User-Agent": `opencode/${InstallationVersion} gitlab-ai-provider/${GITLAB_PROVIDER_VERSION} (${os.platform()} ${os.release()}; ${os.arch()})`,
"User-Agent": `zmo/${InstallationVersion} gitlab-ai-provider/${GITLAB_PROVIDER_VERSION} (${os.platform()} ${os.release()}; ${os.arch()})`,
"anthropic-beta": "context-1m-2025-08-07",
...providerConfig?.options?.aiGatewayHeaders,
}
@@ -743,7 +743,7 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
options: {
apiKey,
headers: {
"User-Agent": `opencode/${InstallationVersion} cloudflare-workers-ai (${os.platform()} ${os.release()}; ${os.arch()})`,
"User-Agent": `zmo/${InstallationVersion} cloudflare-workers-ai (${os.platform()} ${os.release()}; ${os.arch()})`,
},
},
async getModel(sdk: any, modelID: string) {
@@ -788,7 +788,7 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
if (!apiToken) {
throw new Error(
"CLOUDFLARE_API_TOKEN (or CF_AIG_TOKEN) is required for Cloudflare AI Gateway. " +
"Set it via environment variable or run `opencode auth cloudflare-ai-gateway`.",
"Set it via environment variable or run `zmo auth cloudflare-ai-gateway`.",
)
}
@@ -811,7 +811,7 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
skipCache: input.options?.skipCache,
collectLog: input.options?.collectLog,
headers: {
"User-Agent": `opencode/${InstallationVersion} cloudflare-ai-gateway (${os.platform()} ${os.release()}; ${os.arch()})`,
"User-Agent": `zmo/${InstallationVersion} cloudflare-ai-gateway (${os.platform()} ${os.release()}; ${os.arch()})`,
},
}
@@ -837,7 +837,7 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
autoload: false,
options: {
headers: {
"X-Cerebras-3rd-Party-Integration": "opencode",
"X-Cerebras-3rd-Party-Integration": "zmo",
},
},
}),
@@ -846,8 +846,8 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
autoload: false,
options: {
headers: {
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"HTTP-Referer": "https://github.com/helpLogin/zmo-cli",
"X-Title": "zmo",
},
},
}),