Repository navigation
fix(UB-178): make Claude primary and keep HF last - #252
Merged
Merged
Conversation
|
🔁 PR closed. Stage bot switched back to |
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.
Why
Text routing currently prefers z.ai even though Claude is the intended primary. Configured chains and health-based reordering can bring HF ahead of the priority providers. The reserve model examples are also outdated.
Claude 5.5 was added on October 10, before the November 8 retired-model calls reported by Anthropic. The available evidence does not identify ExpenseSyncBot as their source.
Changes
Verification
Current head:
97bcc3c70fa41c2cd7a611ea641887ac94c05f78@ExpenseSyncStageBoton this exact head. The normal read-only stage QA gate returnedgreen for 97bcc3c70fa4 cases=7. These command/redirect cases do not exercise inference.Claude inference evidence, scoped to the earlier head
On
5ab0968916400cbd0972cf85e7a6dad5b1c61e51, the existingscripts/verify-claude-usage.tsran on stage with its credentials and an owned temporary SQLite database. All three real calls passed: Sonnet 5.5 smart text, Haiku 5.5 fast text, and Sonnet 5.5 OCR of a synthetic receipt. Each produced a Claudeokusage row with reported input/output tokens. No other provider request was sent; the temporary database was removed afterward.The current head has identical Git blobs for the Claude clients, credential pools, request parameters, chain/round/slot implementation, breaker, usage recorder and inference-probe script (16 checked files). The follow-up only changes diagnostic requests, examples, comments and the existing HF helper's public export, so it does not warrant repeating the paid stage calls. The production verification below covers the final deployed revision.
The initial patch also passed 252 focused tests across 10 files. A scan of 568 tracked source/configuration files found no Gemini matches. Both configured credentials match Calendar's working pair; the same-key HTTP 200 checks were four shared calls across Haiku and Sonnet, not independent calls per bot. Successful HF inference was not verified: the current account returned 402 and remains an optional reserve.
Production result — 2026-11-13
The normal
gh shippath, including the genuine approved quorum hatch, merged this PR asc1a609cc3942586b2c7aa98085e3d7deccfb282a. The official production deployment 43410582480 succeeded for that exact main/push commit. The running checkout independently matches it.At 16:45 Europe/Belgrade, one isolated probe used the deployed code, the running process environment plus its actual environment file, and the normal configured provider chains. No provider, endpoint, model or credential override was supplied.
Four.Four.TOTAL 12.50All three calls produced successful Claude usage rows. There were zero attempts to other providers. Successful API response status codes are not retained in these usage rows; the proof is the actual returned answer and reported usage, rather than a claimed captured HTTP status.
The effective smart/fast order is Claude → z.ai → HF; OCR is Claude → HF. HF remains the final reserve and its account was not repaired or funded. The scan of active source, scripts and the environment example found no Gemini references, and the effective probe/process environment had no Gemini configuration.
Both PM2 processes remained online with unchanged process IDs and restart counters during verification. Health returned HTTP 200 before and after. The production environment file remained unchanged by the probe, and its temporary database and script were removed. This proves deployed inference through the normal route; it does not claim Telegram end-to-end coverage or inspection of PM2's private in-memory circuit state.
The first automatic production probe stopped before Bun or any API call: its inherited application PATH did not contain
/usr/sbin, so the launcher could not resolverunuser. Its original failed receipt and one-run marker are retained. A separate recorded recovery used the observed absolute/usr/sbin/runuserpath and the unchanged inference probe; it passed. No application change, second deployment, restart or environment change was needed for this diagnostic correction.Refs UB-178