mirror of
https://github.com/NanmiCoder/claude-code-haha.git
synced 2026-10-10 11:53:10 +08:00
fe10efb65f
OpenCode Go binds the wire format to the URL path and translates nothing between formats, so one provider record serves /chat/completions, /messages and /responses depending on the model, each accepting a different credential header. A record carries only one apiFormat, so presets can now declare ordered per-model prefix rules (modelApiFormats) and the proxy resolves the effective format from the request body. Only the exceptions are listed; anything unmatched keeps the provider's format, which is the endpoint with the broadest compatibility. A preset with rules is authoritative for apiFormat, because a value written by a cc-switch import or the edit form would otherwise silently disable every rule and point the CLI straight at the upstream. The gateway also rejects any request without a stable per-conversation x-opencode-session, so presets can declare upstreamHeaders with $SESSION_ID and $VERSION placeholders. The id is the one the CLI already sends; it is redacted in traces the same way the credential is, since it also names the local transcript files. Title generation builds its own upstream request and bypassed all of the above, which left AI titles failing for every provider that needs local request handling; it now goes through the same proxy the CLI uses. Verified against the live gateway: glm/kimi reach /chat/completions, minimax/qwen/union-alpha reach /messages, grok/gpt reach /responses, each with the credential that endpoint accepts.
Claude Code Haha Desktop
基于 Tauri 2 + React 的桌面客户端。
开发
bun install
bun run tauri dev
构建
# macOS (Apple Silicon)
./scripts/build-macos-arm64.sh
# Windows (x64, MSI only)
.\scripts\build-windows-x64.ps1
构建产物位于 build-artifacts/ 目录,文件名会显式包含平台、架构和包类型。
常见问题
macOS 提示"已损坏,无法打开"
xattr -cr /Applications/Claude\ Code\ Haha.app