Repository navigation
fix(quota-plane): lapsed OpenCode Go workspace renders as lapsed, not error (#1161) #7898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
84f0403
a70a475
9b4b6b8
e572e55
2454718
912d172
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -274,7 +274,11 @@ export function buildDigest(inputs: DigestInputs): Digest { | |
| } | ||
| const cappedQ = cap(items); | ||
| const degradedProviders = inputs.quota.pools | ||
| .filter((p) => (p.freshness?.state ?? p.state) === "error" || (p.freshness?.state ?? p.state) === "stale") | ||
| .filter( | ||
| (p) => | ||
| (p.freshness?.state ?? p.state) === "error" || | ||
| (p.freshness?.state ?? p.state) === "stale", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intentional, not an omission: the digest's degradedProviders list is the error/stale set — providers whose reads are failing or aging. A lapsed pool is a terminal, successfully-read state (the subscription ended; the read worked), so it surfaces through its pool state and the explicit lapsed pool note rather than the degraded list, the same way it is not counted in the renderer's error-pool count. Keeping it out of "degraded" is what makes the lapsed state distinct from error, which is the point of this PR. |
||
| ) | ||
| .map((p) => p.provider); | ||
| quotaSection = { | ||
| id: "quota", | ||
|
|
@@ -337,15 +341,19 @@ function quotaPoolNote(pool: QuotaPool, now: Date): string | null { | |
| const worst = pool.windows.reduce((m, w) => Math.max(m, windowPercent(w)), 0); | ||
| const parts: string[] = []; | ||
| // Provider freshness (#5279 Codex): quota-current marks a pool | ||
| // error/stale while retaining its historical windows, but poolState() | ||
| // error/stale/lapsed while retaining its historical windows, but poolState() | ||
| // derives only utilization — without this, a failed pool with low | ||
| // windows would vanish from the outlook and a stale high reading | ||
| // would read as a current forecast. | ||
| const degraded = pool.freshness?.state ?? (pool.state === "error" || pool.state === "stale" ? pool.state : null); | ||
| const degraded = pool.freshness?.state ?? (pool.state === "error" || pool.state === "stale" || pool.state === "lapsed" ? pool.state : null); | ||
| if (degraded === "error") { | ||
| parts.push( | ||
| `provider read error${pool.freshness?.error ? `: ${pool.freshness.error}` : ""} — current readings unavailable; any figures below are the last successful read`, | ||
| ); | ||
| } else if (degraded === "lapsed") { | ||
| parts.push( | ||
| `provider lapsed${pool.freshness?.error ? `: ${pool.freshness.error}` : ""} — plan cancelled; no current readings`, | ||
| ); | ||
| } else if (degraded === "stale") { | ||
| parts.push( | ||
| `provider read stale${pool.freshness?.measuredAt ? ` (measured ${pool.freshness.measuredAt})` : ""} — figures are the last read, not current`, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.