cli: OpenCode Go uses Console credential instead of selected OpenCode Go credential
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- cli, typescript
- 领域
- cli
调研方向
The bug is in how the opencode-go provider picks its credential, so start with the provider and auth code that reads the active credential from opencode.db and the /api/provider integration lookup. Reproduce by storing two Go credentials, switching with opencode auth switch opencode-go, then running a Go model and checking which x-opencode-org-id is sent. Done means the provider uses the active "OpenCode Go" credential rather than the Console one, and the switch takes effect without a restart.
由索引模型根据 Issue 内容生成。
描述
Summary
The opencode-go provider ignores the active credential selected under "OpenCode Go" (opencode auth switch opencode-go <label>). It keeps billing requests to the workspace of the active "OpenCode Console" credential, so switching Go accounts has no effect and the user hits the other account's weekly Go limit.
Environment
- opencode version: 2.1.3
- OS: Linux 7.3.6-arch1-1 (x86_64)
- Terminal: alacritty (TERM=xterm-256color, COLORTERM=truecolor)
- Shell: /bin/zsh
- Install/channel: latest
- Active plugins: opencode-screenshot-vision
Reproduction
- Have two OpenCode Go credentials stored (
opencode auth list): "A" and "B", belonging to different workspaces. - Have an active "OpenCode Console" credential that belongs to workspace B.
- Run
opencode auth switch opencode-go A. The active flag in the DB for "OpenCode Go" becomes A. - Run a Go model, e.g.
opencode run -m opencode-go/glm-5.3-flash "hi". - Observed:
OpenCode Go usage limit reached (weekly...)with the workspace URL of B.GET /api/providershowsopencode-gowithintegrationID: "opencode"andx-opencode-org-id= workspace B. - Calling the Go endpoint directly with A's key and workspace A's org header returns 200. With B's key it returns 429.
- Adding A's key under "OpenCode Console" and making it active fixes it without restarting the service.
Expected Behavior
The Go provider should use the active credential of the "OpenCode Go" integration.
Actual Behavior
The provider uses the active "OpenCode Console" credential. Switching the Go credential has no effect. --standalone and OPENCODE_API_KEY do not override it either.
Additional Context
- Workspace IDs and key values are redacted.
- In
opencode.db,credential.active= 1 for "OpenCode Go / A", but the Go provider was billing workspace B. - Workaround: add the key under "OpenCode Console" and make it active.
- 主要语言
- TypeScript
- 星标
- 230k
- 派生
- 31.3k
- 平均合并
- 5 小时 32 分钟
- 30 天内合并 PR
- 453
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
难度 1/5 1-3 小时 新手友好度 88/100
anomalyco/opencode#67064 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 82/100
anomalyco/opencode#67009 · 2 条评论 ·
维护者通常 1 天内回复
-
area/web type/feature version/v2
难度 2/5 1-3 小时 新手友好度 78/100
anomalyco/opencode#67001 · 3 条评论 ·
维护者通常 1 天内回复
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any log可能已有人在做 @liwenjie200543 于 2 天前认领。 未关闭area/plugins platform/linux reproduced type/bug version/v2
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#66970 · 4 条评论 ·
维护者通常 1 天内回复
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaks可能已有人在做 @argszero 于 2 天前认领。 未关闭area/tui platform/wsl status/repro-simulated type/bug version/v2
难度 2/5 1-3 小时 新手友好度 82/100
anomalyco/opencode#66773 · 4 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
enhancement feature/signals self-driving team/self-driving
难度 2/5 1-3 小时 新手友好度 78/100
PostHog/posthog#144208 · 1 条评论 ·
维护者通常 1 天内回复
-
bug good first issue web
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
triage: not actionable
难度 2/5 1-3 小时 新手友好度 66/100
oxc-project/oxc#30518 · 1 条评论 ·
维护者通常 1 天内回复
-
bug Claude useability
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 70/100
wazuh/wazuh-dashboard-plugins#9751 ·
维护者通常 1 天内回复