Conversation
…and no invented reset
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
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.
Summary
StepFun Token Plan (credit) payloads now produce a usable snapshot instead of failing with "Missing StepFun five-hour usage". Credit plans show a single primary lane labelled Credit, never get an invented reset date, and Coding Plan snapshots keep their 5-hour / Weekly labels and lanes.
Found by the 0.60.4-0.69.0 port gap audit (0.63.0 item #13).
Upstream reference
7a1704fff).Sources/CodexBarCore/Providers/StepFun/StepFunUsageFetcher.swift(StepFunRateLimitResponse.isCreditPlan,StepFunPlanCreditRateLimit.totalCreditLeftRate,StepFunUsageSnapshot.toUsageSnapshotcredit branch),StepFunProviderDescriptor.swift(rateWindowLabels).Ported / Deferred
Ported (
rust/src/providers/stepfun/mod.rsonly):plan_family,plan_credit_rate_limit(subscription_credit_left_rate,subscription_credit_reset_time,topup_credit_left_rate,credit_buckets[].credit_total/credit_residual), all names taken from the upstream decoder.plan_family == 2only as tie-breaker.used = clamp((1 - left) * 100), left rate weighted from sound buckets (residual/total), else subscription rate, else top-up rate (never summed).subscription_credit_reset_timestays unknown: noresets_at, no reset description, no window minutes. A real reset sets monthly window minutes via the existingRateWindow::monthly_window_minutes.primary_label = "Credit"via the existingUsageSnapshot::primary_label; the Tauri bridge, tray and CLI already consume it. Coding Plan still requires the five-hour and weekly fields.Left out:
UsageSnapshot.primaryis non-optional, so this shows an informational "No credit balance reported" primary (the same pattern used by Amp/Antigravity), not an error and not a quota percentage.ProviderPaceCapability.monthlyWindowSentinelMinutesis replaced by the local calendar-month helper, matching how other monthly providers (Abacus) are handled.expire_at/next_reset_atbucket fields are unused by upstream's snapshot and are not modelled.5h Window): unrelated to this item.Validation
cargo +1.98.0 fmt --all: cleancargo +1.98.0 clippy --workspace --all-targets -- -D warnings: pass (both manifests)cargo +1.98.0 test -p codexbar stepfun: 11 passed, 0 failed (8 new: coding-plan regression and missing-field error, credit with reset, no/zero reset, bucket weighting, unsound-bucket fallback, no-balance credit family, live window beats credit family)cargo test -p codexbarand frontend tests were not run.Affected areas
Provider: StepFun. Tray/dashboard/CLI primary-lane label (Credit) and reset line.
UI proof
Pending: coordinator will capture CUA proof on a fresh build.