Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
Reviewed by Codex gpt-6-luna (xhigh); verified and validated by Claude Thermo-nuclear review of this PR: no findings. Warning identity state stays isolated from provider fetching and Claude-specific scope classification stays in the shell. Nothing to fix, no commit. Codex did not run cargo; the diff was reviewed only. |
Adversarial validation (lane-A) at fed9068Review verdict: the branch at its published head matches the 0.66.0 audit PR-9 spec; local HEAD equals the remote head ( Checks at fed9068 (CARGO_TARGET_DIR=W:\cargo-target\lane-a, jobs=4, RUST_TEST_THREADS=4):
No new code was required; validation-only item. |
Summary
Claude threshold toasts no longer repeat when the CLI/OAuth source alternates between samples that resolve an account email and samples that cannot (
claude:cli:unknown/claude:oauth:unknown). Previously each identity key fired the same high/critical toast once, so alternating samples alerted twice per threshold.Behavior (session and weekly lanes):
resets_atis unchanged and usage has not dropped (remaining has not increased).shared_with_unresolved), so each threshold fires once across alternation.Implementation: new provider-agnostic
rust/src/notifications/identity_gaps.rs(WarningScope,NotificationManager::resolve_warning_account); the Claude-specific classification lives inwarning_identity.rs::gap_scope;notify_usage_thresholdsresolves the toast account per lane beforecheck_session_lane/check_and_notify.NotificationManagertoasts are recorded instead of shown undercfg(test).Upstream reference
5f5529ac.Sources/CodexBar/UsageStore+QuotaWarnings.swift(QuotaWarningState.resetsAt,sharedWithUnresolvedAccount, adoption block inhandleQuotaWarningTransition),Sources/CodexBar/PredictivePaceWarnings.swift(reconcileClaudeQuotaWarningOwner,lastClaudeQuotaWarningAccount),Tests/CodexBarTests/ClaudeCredentialQuotaWarningTests.swift(checkIdentitySamplescases, ported asidentity_gaps/tests.rs),docs/claude.md.Ported / Deferred
Ported: session and weekly lanes, all five upstream identity-gap test sequences (with and without reset), plus session-depleted merge and independent-scope tests.
Deferred / differences:
claude-weekly-scoped-*): this repo does not emit threshold toasts for extra rate windows yet, so nothing to bridge. The mechanism is keyed by window string and applies unchanged once such lanes are notified.dispatch_quota_hooks,emit_quota_threshold_hooks) intentionally unchanged: like upstream (hookAccountDiscriminatorstays on the source key) it keeps per-source edge baselines whose first sample never fires.observedAtordering is replaced by an in-process observation sequence (samples are processed serially); the local level-based toast model (high/critical/exhausted, cleared below high) replaces upstream remaining-percent threshold lists, withremaining = 100 - used.Validation
Toolchain
cargo +1.98.0, E-core wrappers, slot-1.cargo fmt --all: cleancargo clippy --workspace --all-targets -- -D warnings: passcargo test -p codexbar(full): 2168 passed, 0 failed, 1 ignored (includes 21notificationstests: 8 new)cargo test -p codexbar-desktop-tauri: 462 passed, 1 failed:commands::tests::bootstrap_payload_exposes_every_provider_variant(provider catalog size vs active providers; untouched by this change, appears to be a base-branch issue)Affected areas
rust/src/notifications)commands/providers.rs,commands/warning_identity.rs)UI proof
Not applicable (toast dedupe only; no tray/settings/React change). Unit-level proof:
identity_gaps/tests.rscounts toasts per sequence.