Repository navigation
Conversation
#1174) Typed QuotaAction derivation (buildQuotaActions): cancelled-period expiry within 14 days from the plan-facts registry, walled pools, and >85% windows with reset >24h out. Same entries render on /quota's attention strip (via usage.attention), /today (alerts + objectives), and /attention's orchestrator tier (task items). Entries exist only while their condition holds.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 29 minutes. View limit details
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. CodeRabbit Verify
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39c62cbf46
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (const w of pool.windows) { | ||
| const pct = windowPercent(w); | ||
| if (pct > worstPct) { | ||
| worstPct = pct; | ||
| worst = w; |
There was a problem hiding this comment.
Check reset eligibility before selecting the highest-usage window
For a pool with multiple windows, a higher-percentage short window can mask a qualifying longer window. For example, a 5-hour window at 99% resetting in two hours and a weekly window at 92% resetting in four days produce no action: the loop selects the 5-hour window, then rejects its reset without considering the weekly window. The same happens when the highest window has no reset recorded, a shape produced by extractClinePass in quota-extract.ts. Filter for valid, distant resets before selecting the highest percentage so qualifying warnings remain visible.
Useful? React with 👍 / 👎.
| attention: [...buildAttentionFlags(feed.quota, partial), ...feedChargeFlags], | ||
| attention: [ | ||
| ...buildAttentionFlags(feed.quota, partial), | ||
| ...quotaActionFlags(buildQuotaActions(feed.quota, AA_PLAN_FACTS)), |
There was a problem hiding this comment.
Derive quota-strip actions from the overlaid quota view
When quota-current.json contains a fresh gatherer reading, source.quota() applies overlayQuotaCurrent, which replaces windows and recomputes pool state, but this path derives the new actions from the unoverlaid feed.quota. Consequently, a formerly walled pool that the gatherer now reports as healthy still displays a walled action on /quota, while Today and Needs You correctly clear it; newly high usage can likewise be missing from the strip. Derive these actions from the same overlaid quota view used by the other surfaces, including in the direct-read fallback.
Useful? React with 👍 / 👎.
| view.orchestratorExtra = [ | ||
| ...view.orchestratorExtra, | ||
| ...quotaActionTierItems(buildQuotaActions(quota, AA_PLAN_FACTS)), | ||
| ]; |
There was a problem hiding this comment.
Include synthesized quota tasks in the attention API
Whenever an eligible quota action exists, adding its task only to orchestratorExtra makes it visible in the HTML queue but absent from /api/attention.json: that handler serializes only view.all and view.watchdog, neither of which receives these tasks. The page explicitly advertises that endpoint as its machine-first interface, so machine consumers cannot discover or act on the new quota tasks despite their appearance in Needs Orchestrator. Include the synthesized tasks in the API response with the corresponding tier annotation.
Useful? React with 👍 / 👎.
Summary
Adds typed deadline/action facts (including cancelled OpenCode Go Personal/Lab), and derives expiring, walled/billing, and high-usage actions without parsing display prose.
Evidence
bun test test/quota-actions-1174.test.ts test/quota-contract.test.ts— 22 pass after merging currentmain(9dfc29e).web-pushdependency; clean-main baseline showed the same pre-existing failures.Merge Danger
Door: two-way
Blast Radius: narrow — aggregator quota actions and their three render surfaces.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.