Repository navigation
fix(kb): fall back to Zcode GLM-5.3 when Claude Code is unavailable - #287
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 885e18dfb5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| logger.warning("Knowledge generator %s unavailable; trying configured fallback %s", | ||
| role.label(), role.fallback.label()) | ||
| try: | ||
| return self._call_json(role.fallback, fallback_from=role.label(), **kwargs) |
There was a problem hiding this comment.
Recheck subscription billing before dispatching the fallback
When kb init runs with --subscription-generator, generate() verifies subscription_billing() only for the primary role and then calls this method without a spend threshold. If that primary fails and the fallback is Zcode configured through ZCODE_PROVIDER_ID to use a custom API provider, ZCodeTransport.subscription_billing is false, but this branch dispatches it anyway without reserving or charging the initialization budget. Preserve the verified billing mode for the fallback, or disable fallback on this path unless its transport also passes subscription_billing().
Useful? React with 👍 / 👎.
The knowledge updater repeatedly receives a Claude Code account-hold response and leaves upstream PR events queued. Add an opt-in
KB_GENERATOR_FALLBACK=zcode:GLM-5.3so generation tries the pinned Zcode model once when CC is unavailable, while Codex remains the judge.Every attempt records the actual model and fallback origin; intake, refinement, and sweep changes record the generator that supplied the accepted draft, and rebuilds preserve that attribution. Both-generator failures keep events queued. Schema repair and calls with reserved spend thresholds retain their existing behavior.
Validation: 184 targeted offline tests passed. Both GitHub CI runs passed, including the full unit suite, packaged wheel checks, and document/SPEC/knowledge validators. Live checks confirmed CC account hold followed by Zcode serving GLM-5.3; the restarted KB updater has also recorded successful GLM-5.3 calls from its real event queue.
The new wheel is deployed to the KB service with
KB_GENERATOR_FALLBACK=zcode:GLM-5.3. Snapshot activation remains subject to the existing provenance gate.