Skip to content

Instantly share code, notes, and snippets.

@zsnmwy
Last active March 4, 2026 22:54
Show Gist options
  • Select an option

  • Save zsnmwy/457499f65a6d25c382ee78cc2ae44152 to your computer and use it in GitHub Desktop.

Select an option

Save zsnmwy/457499f65a6d25c382ee78cc2ae44152 to your computer and use it in GitHub Desktop.
~/.config/opencode/oh-my-opencode.json
{
"$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
"google_auth": false,
"tmux": {
"enabled": true,
"layout": "main-vertical",
"main_pane_size": 60,
"main_pane_min_width": 120,
"agent_pane_min_width": 40
},
"agents": {
"sisyphus": {
"model": "zhipuai-coding-plan/glm-5"
},
"hephaestus": {
"model": "zenmux/openai/gpt-5.2-codex",
"variant": "xhigh"
},
"atlas": {
"model": "zhipuai-coding-plan/glm-5"
},
"sisyphus-junior": {
"model": "zhipuai-coding-plan/glm-5"
},
"prometheus": {
"disable": false,
"model": "zenmux/anthropic/claude-opus-4.6",
"variant": "max",
"prompt_append": "在编码的规划中,需要将项目中“docs/编码规范.md”中的规范文档应用到编码中,需要强制做到Plan里面,指导后续的编码工作。如果项目中没有该文件,则不需要应用。"
},
"plan": {
"model": "zenmux/anthropic/claude-opus-4.6"
},
"oracle": {
"model": "zenmux/openai/gpt-5.2",
"variant": "xhigh"
},
"OpenCode-Builder": {
"model": "zenmux/openai/gpt-5.2-codex",
"variant": "xhigh"
},
"metis": {
"model": "zhipuai-coding-plan/glm-5"
},
"momus": {
"model": "zenmux/openai/gpt-5.2",
"variant": "xhigh"
},
"librarian": {
"model": "zhipuai-coding-plan/glm-5"
},
"explore": {
"model": "zenmux/x-ai/grok-code-fast-1"
},
"frontend-ui-ux-engineer": {
"model": "google/gemini-3-pro-preview"
},
"document-writer": {
"model": "google/gemini-3-flash-preview",
"prompt_append": "当你无法读取文件的时候,尝试使用cat,sed等文本工具进行读取。"
},
"multimodal-looker": {
"model": "google/gemini-3-flash-preview"
},
"General": {
"model": "zhipuai-coding-plan/glm-5"
}
},
"categories": {
"general": {
"model": "zhipuai-coding-plan/glm-5"
},
"visual-engineering": {
"model": "google/gemini-3-pro-preview"
},
"artistry": {
"model": "google/gemini-3-pro-preview"
},
"writing": {
"model": "google/gemini-3-flash-preview"
},
"quick": {
"model": "zhipuai-coding-plan/glm-5"
},
"unspecified-low": {
"model": "zhipuai-coding-plan/glm-5"
},
"unspecified-high": {
"model": "zhipuai-coding-plan/glm-5"
}
}
}
@zsnmwy
Copy link
Author

zsnmwy commented Feb 20, 2026

ZenMux - Anthropic Claude 1M Token 长上下文窗口

OpenCode 插件配置

非ZenMux的供应商自行替换,配置需求应该没变

import type { Plugin } from "@opencode-ai/plugin"

const CONTEXT_1M_BETA = "context-1m-2025-08-07"

const SUPPORTED_MODELS = [
  "opus-4-6",
  "opus-4.6",
  "sonnet-4-5",
  "sonnet-4.5",
  "sonnet-4-20250514",
  "claude-opus-4.6",
  "anthropic/claude-sonnet-4.6",
  "anthropic/claude-opus-4.6"
]

export const plugin: Plugin = async () => ({
  "chat.params": async (input, output) => {
    if (input.model.providerID !== "zenmux") return
    if (!input.model.api.id.includes("claude")) return
    if (!SUPPORTED_MODELS.some((m) => input.model.api.id.includes(m))) return
    const existing = output.options.anthropicBeta ?? []
    if (existing.includes(CONTEXT_1M_BETA)) return
    output.options.anthropicBeta = [...existing, CONTEXT_1M_BETA]
  },
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment