Skip to content

fix(v2): 修复余额查询读取宿主 SQLite 凭据 - #41

Merged
Hotakus merged 1 commit into
masterfrom
fix/v2-credentials-db
Sep 25, 2026
Merged

Hotakus merged 1 commit into
masterfrom
fix/v2-credentials-db

Conversation

@Hotakus

@Hotakus Hotakus commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

功能

  1. 修复 V2 余额查询无法读取宿主 SQLite 凭据的问题:
    • credential 表中 active 列为 NULL(从未显式禁用)的记录被错误过滤,现兼容 NULL 视为启用
    • 数据库中凭据 type 字段为 key(API Key 类型)可能不被识别,现同时兼容 api 与 key
    • 余额 provider ID(如 moonshot)与 OpenCode 集成 ID(如 moonshotai-cn)不一致时,现优先用集成 ID 去查库

验证

  • npm run typecheck 通过
  • npm run build 通过
  • npm run test:credentials 通过
  • 实测本地 ~/.local/share/opencode/opencode.db 中 3 个 provider(deepseek、moonshotai-cn、openrouter)均能正确解析 key,余额查询恢复正常

@Hotakus Hotakus self-assigned this Sep 25, 2026
@Hotakus Hotakus added the bug Something isn't working label Sep 25, 2026
@Hotakus
Hotakus merged commit 381e384 into master Sep 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant