Repository navigation
blackbox: cpa proxy turns → lane cpa + served vendor/provider, priced estimated (stacked on #1392) - #1396
Conversation
…ider, priced estimated (t_d59c7936)
- usage_pricing: NOTIONAL_PROXY_PROVIDERS (cpa, kimi-code, kimi-cpa,
cliproxyapi, + custom:<name>) re-route per SERVED model vendor via the
one map _infer_vendor_from_model: moonshotai->kimi-oauth route,
openai->openai-codex, xai->xai-oauth; unknown vendor stays unpriced.
codex-* added to the openai vendor prefix. attribute_route() gives
{vendor, vendor_label, served_provider}; unknown -> vendor-unknown.
- blackbox store: lane_family never returns 'other' (proxy -> cpa,
custom:<name> unwrapped, else the provider's own name, empty -> unknown);
backfill uses lane_family() instead of a SQL copy and re-derives stored
'other' rows. turns gains lane_family/vendor/served_provider, turn_api_calls
gains vendor/served_provider (guarded additive ALTER).
- last_turn: proxy turns render 'Route: vendor Kimi (Moonshot) · provider kimi · lane cpa'.
Verified: new test file 52 passed; 41 fail with store.py+last_turn.py reverted;
blackbox + usage_pricing + kimi-oauth neighbours 456 passed.
7fc5851 to
4071e0e
Compare
|
🤖 merged-by: apollo · lane: kanban-merge-pass · gate: ADVISORY (FleetReview not green for 4071e0e): fleetreview-advisory-20260927-standing.md · why: t_d59c7936: Blackbox: CLIProxyAPI (cpa) turns attributed to vendor/provider Kimi (etc.) with; Argus off card review (Ace 13:08), CI green |
FleetReviewReview: post-merge · head Post-merge review ( Reviewed with 2 of 3 model families — xai unavailable. profile: light (rule: default light: lines 297<800, files 4<1000000, hunks 15<1000000, no hot path) · round 0 · members: B-state, L6, C-assert-xhigh, G · families: anthropic,openai Confidence: 3/5 Findings
FleetReview provenance · models: B=gpt-6-sol, C=claude-code-opus-5-5, D=grok-4.6, F=gpt-6-sol · cost: $2.55 · duration: 13m 29s · rounds: 2 · files examined: 4 |
…priced resolve_billing_route returns billing_mode=unknown for a cpa/kimi-code/ kimi-cpa/cliproxyapi turn whose served vendor is not in _PROXY_VENDOR_PRICING_LANE, but get_pricing_entry still reached the M1 vendor fallback, so claude-*/gemini-* via cpa priced estimated at direct vendor rates and is_known_model reported them known. get_pricing_entry now returns None and is_known_model False for such a route. FleetReview P1 on #1396 (key c56cf5329e7c), card t_244968e4. Verified: test_cpa_lane_attribution.py + test_usage_pricing.py 186 passed; source reverted -> 12 new cases fail.
…priced resolve_billing_route returns billing_mode=unknown for a cpa/kimi-code/ kimi-cpa/cliproxyapi turn whose served vendor is not in _PROXY_VENDOR_PRICING_LANE, but get_pricing_entry still reached the M1 vendor fallback, so claude-*/gemini-* via cpa priced estimated at direct vendor rates and is_known_model reported them known. get_pricing_entry now returns None and is_known_model False for such a route. FleetReview P1 on #1396 (key c56cf5329e7c), card t_244968e4. Verified: test_cpa_lane_attribution.py + test_usage_pricing.py 186 passed; source reverted -> 12 new cases fail.
…priced resolve_billing_route returns billing_mode=unknown for a cpa/kimi-code/ kimi-cpa/cliproxyapi turn whose served vendor is not in _PROXY_VENDOR_PRICING_LANE, but get_pricing_entry still reached the M1 vendor fallback, so claude-*/gemini-* via cpa priced estimated at direct vendor rates and is_known_model reported them known. get_pricing_entry now returns None and is_known_model False for such a route. FleetReview P1 on #1396 (key c56cf5329e7c), card t_244968e4. Verified: test_cpa_lane_attribution.py + test_usage_pricing.py 186 passed; source reverted -> 12 new cases fail.
Card t_d59c7936. Stacked on #1392 (native kimi-oauth + K3 snapshot + Kimi in
_infer_vendor_from_model). This branch contains #1392's commits; merge #1392 first, then this rebases to one commit (7fc5851).Problem
A
cpa/kimi-k3turn (CLIProxyAPI, which serves Kimi, Codex and Grok behind one key) was recorded asprovider=cpa,lane_family='other', with no vendor and no cost (billing_mode=unknown).Change
agent/usage_pricing.pyNOTIONAL_PROXY_PROVIDERS = {cpa, kimi-code, kimi-cpa, cliproxyapi}, also reached ascustom:<name>.resolve_billing_routedispatches a proxy turn on the SERVED model's vendor. It uses the one existing map,_infer_vendor_from_model: moonshotai goes to the kimi-oauth route (K3 snapshot), openai to openai-codex (OpenRouter notional), xai to xai-oauth. All three areestimated. An unknown vendor stays unpriced.codex-*joins the openai vendor prefix.attribute_route(provider, model)returns{vendor, vendor_label, served_provider}.cpa/kimi-k3givesmoonshotai,Kimi (Moonshot),kimi. An unknown model givesvendor-unknown, neverother.plugins/blackbox/store.pylane_familynever returnsother. Proxy lanes returncpa, acustom:<name>lane is unwrapped, anything else returns its own provider name, and an empty provider returnsunknown.lane_family()and no longer keeps a SQL copy of the map. It also re-derives rows already stored asother.turns.lane_family/vendor/served_providerandturn_api_calls.vendor/served_provider, written at insert.plugins/blackbox/last_turn.py: proxy turns get a• Route: vendor Kimi (Moonshot) · provider kimi · lane cpaline. Other lanes are unchanged.Not in scope: the subs.ace and tokens.ace renderers (
scripts/subs_datain hermes-home) belong to the sibling Kimi usage card, which consumesattribute_routeand the new columns.Verified
tests/plugins/blackbox/test_cpa_lane_attribution.pyhas 52 tests. They cover kimi, gpt, codex and grok through every alias andcustom:cpa, pricing parity with the native lanes ($0.00465 for 1k/100/500 on K3), the vendor-unknown negative control, everyproviders.list_providers()name and alias mapping to a named family, the stored columns, the backfill retiringother, and the last-turn line. All 52 pass. With store.py and last_turn.py reverted, 41 of them fail.test_codex_auto_review_stays_unknownstill passes.cpa/kimi-k3turn on tokens.ace. That waits for the batched restart.Override: none by design — the 4 refusal lines are #1392's kimi-oauth device-flow terminal errors (
access_denied/expired_tokenin hermes_cli/auth.py), carried here only because this PR is stacked on #1392; a user who denied the browser login must log in again, no operator bypass applies. This PR adds no refusal of its own.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.