OpenCode Zen model_id strip proxy + SessionStart hook for Grok Build (mise shim) A developer has created a local proxy for OpenCode Zen that strips the non-standard `model_id` field from Grok CLI assistant history before forwarding requests to the upstream Chat Completions API. The proxy, written in Bun, sanitizes JSON bodies for `/chat/completions`, `/responses`, and `/messages` endpoints, ensuring compatibility with OpenCode Zen's API. | / | | OpenCode Zen 向けローカルプロキシ | | | | Grok CLI が assistant 履歴に付ける非標準フィールド model id を | | Chat Completions 送信前に削除してから upstream へ転送する | | | | 起動: bun ~/.grok/proxies/opencode-strip-model-id/proxy.ts | | 設定: base url = "http://127.0.0.1:8787/v1" | | / | | | | const LISTEN HOST = process.env.PROXY HOST ?? "127.0.0.1" | | const LISTEN PORT = Number process.env.PROXY PORT ?? "8787" | | const UPSTREAM ORIGIN = | | process.env.OPENCODE UPSTREAM ?? "https://opencode.ai/zen" | | .replace /\/$/, "" | | const LOG = process.env.PROXY LOG === "1" | | | | type JsonObject = Record