Skip to content

Port upstream 0.65.0: Bifrost parity polish (stacked on #619) - #675

Open
Finesssee wants to merge 12 commits into
codex/port-0.65-provider-packfrom
port/micro-0.65.0-bifrost-parity
Open

Finesssee wants to merge 12 commits into
codex/port-0.65-provider-packfrom
port/micro-0.65.0-bifrost-parity

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Summary

Aligns the Bifrost provider (added in #619) with the tagged upstream v0.65.0 bifrost.ts where the local port differed:

  • Identity: account label is the trimmed virtual_key_name (omitted when empty or blank); organization is the first root budget's source_name; login method stays "API".
  • A rate-limit token/request dimension with a reset duration but no positive max is now an unknown-usage named window (0%, reset label only). A dimension with neither is still skipped.
  • Model spend rows: names drop a leading region token, vendor prefix, -vN:N revision and trailing YYYYMMDD / YYYY-MM-DD date; the provider is prefixed only when the visible rows mix providers; two visible rows with the same short name show the raw name. Token counts use K/M/B thresholds (1000 / 999500 / 999500000), one decimal below 10, exact ties rounding up as upstream's toFixed does.
  • Extra root-budget windows use bifrost-budget-<budget id> ids (was a description-derived id).
  • A budget with no current_usage is a known zero.

Also moved the module tests to a sibling tests.rs (the module was already over 1000 lines; it is now 882) and put the label helpers in model_labels.rs.

Upstream reference

Ported / Deferred

Ported: gaps (a) through (e) from the 0.65.0 audit for #619.
Deferred: none. Upstream's 429 Retry-After handling is a separate, known divergence not in this PR.

Validation

All run on Rust 1.98.0, E-core wrapper, slot-6 target dir:

  • cargo +1.98.0 fmt --all: clean
  • cargo +1.98.0 clippy --workspace --all-targets -- -D warnings: pass
  • cargo +1.98.0 test -p codexbar bifrost -- --test-threads=4: 21 passed, 0 failed (11 new: identity, blank identity, reset-only unknown window, root extra ids, missing current_usage, model normalization + token counts, mixed-provider prefix, collision fallback, five-row cap, plus model_labels unit tests)

No shared code, Tauri crate or frontend changed, so the full codexbar suite and vitest were not run.

Affected areas

  • Rust backend (provider: Bifrost only)
  • Tauri shell
  • Frontend
  • Docs

UI proof

Not applicable. No UI code changed; only the strings and identity data the existing Bifrost card renders.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 597919f1-b69a-40db-be44-1dd621781bb1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Reviewed by Codex gpt-6-luna (xhigh); verified and validated by Claude

Thermo-nuclear review of PR #675 against the bifrost-parity spec (0.65.0). All five behavior points are covered by co-located tests. No frontend, locale, a11y or bridge changes needed.

Findings (1):

  • P3 rust/src/providers/bifrost/model_labels.rs:28 - model_name trimmed a trailing -/whitespace even when no date suffix was stripped, so model- became model. Fix: removed the unconditional trim and added a model- regression case.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Fixes landed at the head of this branch (1 of 1 finding fixed, none left).

Commands run: cargo +1.98.0 fmt --all --check, cargo +1.98.0 clippy --all-targets -- -D warnings on both manifests (clean), cargo +1.98.0 test --manifest-path rust/Cargo.toml bifrost (21 passed). No frontend changes, so vitest not run.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Adversarial validation (lane-A) at 778c891 — CI diagnosis + re-merge

CI failure root cause: the failing CircleCI run (pr-check job 953, pipeline 920, sha fce4584a) is a stale-environment failure, not a branch defect. The run executed on 2026-09-30 13:16Z against an origin/main that predates the #619/#620 stack it now stacks on (the branch base is codex/port-0.65-provider-pack @ 669910bd, and the stack has since advanced through #620's account-source pack and the build_fetch_context merge fixes). Reproduction on the exact head fce4584a in a current target dir shows all green:

  • cargo fmt --all --check: pass
  • cargo clippy (both manifests, --all-targets -- -D warnings): only the 3 documented pre-existing main-drift sites; 0 in this PR's diff
  • cargo test rust manifest: 2266 passed / 0 failed / 1 ignored (bifrost focused: 21/0)
  • cargo test desktop manifest: 489/1 — the single failure is bootstrap_payload_exposes_every_provider_variant, the documented Isolate bootstrap payload test from real settings #684 environment-dependent baseline on branches without Make the bootstrap catalog test hermetic (#684) #711 (expected; hermetic fix on release/v0.70.0)

Refresh applied: merged the current #620 head (4663218d) and re-merged the published head (fce4584a) so the branch builds on the fresh stack (f7931d15, 778c891f). Zero conflicts, no code changes to the parity work itself; the review verdict on the diff (3fb049ab..fce4584a) is unchanged — all five behavior points (identity from virtual_key_name/source_name, reset-only unknown windows, model label normalization + K/M/B token counts, bifrost-budget-<id> extra ids, missing-current_usage known zero) covered by the 21 co-located tests.

Re-run requested: hosted CI should re-trigger on this push; the failure is expected to clear.

Fast-forward pushed fce4584a..778c891f (ls-remote verified).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant