fix(usage,tui): /usage while busy; repair every coding-plan probe base normalization - #2537
Merged
Merged
Conversation
…e normalization
Two user reports, one systemic root cause.
1. /usage queued behind runs: shouldExecuteWhileBusy whitelist missed
it, so the panel (pure UI + async vendor probes, zero agent
dependency) only appeared after the run finished. Added to the
always-safe list; test pinned.
2. 'Unsupported' panel for coding-plan users (zhipu, kimi): the probes
appended endpoint paths to the configured chat base WITHOUT
normalizing it, producing 404 paths:
- ZaiProbe: .../api/coding/paas/v4 + /api/monitor/... ; also only
matched open.bigmodel.cn while ggcode.example.yaml ships
api.z.ai international endpoints, and never stripped
/api/anthropic entries.
- KimiProbe: matched NO host at all (#2394 over-correction) even
though Kimi Code platform lives on its OWN host api.kimi.com
(keys sk-kimi-*, disjoint from the open platform's
api.moonshot.cn) and its usage endpoint is the constant
/coding/v1/usages - the old code appended /v1/usages to the
/coding/v1 base (double /v1, 404).
- DeepSeek/Moonshot: chat bases carry /v1, balance endpoints are
root-anchored -> /v1/user/balance, /v1/v1/users/... 404s.
- Minimax: /v1 and /anthropic bases doubled into
/v1/v1/api/openplatform/...
- Openrouter: /api/v1 bases doubled into /api/v1/api/v1/credits.
All probes now normalize every base shape from ggcode.example.yaml
to their endpoint's true anchor. MatchesURL ownership: kimi.com ->
KimiProbe, moonshot.* -> MoonshotProbe (single-owner rule intact,
hosts are disjoint). Regression pins cover every base shape per
vendor, run against mock servers asserting exact request paths.
Tests: internal/usage and internal/tui suites green.
Co-Authored-By: ggcode <noreply@ggcode.dev>
This was referenced Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
用户报告
根因(系统性)
各 probe 把端点路径直接拼在配置的 chat base 后,未归一化 base 形状 → 404 → 面板显示'不支持':
另:/usage 加入 shouldExecuteWhileBusy 白名单(纯 UI+异步探测,无 agent 依赖)。
测试
新增 adapters_coding_base_test.go:每 vendor 全 base 形状(ggcode.example.yaml 逐一对照)打 mock server 断言精确请求路径;域名归属断言(kimi.com≠moonshot.* 单一属主);两包测试全绿。
Co-Authored-By: ggcode noreply@ggcode.dev