Skip to content

Support monthly Amp subscriptions and 8 PM EDT free tier reset - #2601

Merged
steipete merged 7 commits into
steipete:mainfrom
3kh0:feat/amp-subscriptions-monthly-and-free-tier-edt-reset
Aug 14, 2026
Merged

Support monthly Amp subscriptions and 8 PM EDT free tier reset#2601
steipete merged 7 commits into
steipete:mainfrom
3kh0:feat/amp-subscriptions-monthly-and-free-tier-edt-reset

Conversation

@3kh0

@3kh0 3kh0 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Amp launched monthly subscriptions (Megawatt/Gigawatt) that report two independently-metered usage pools — "other usage" and "orb usage" — alongside the existing Amp Free daily tier, individual credits, and workspace balances. The amp usage CLI now outputs renewal periods in months (e.g. resets upon renewal in 1 month), which the previous parser silently ignored.

This PR:

  • Parses month-based subscription renewals — the subscription regex now accepts days?|months?, and a new subscriptionResetDate(value:unit:now:) helper computes the reset date using Calendar.date(byAdding: .month, ...) for months.
  • Sets the Amp Free "resets daily" countdown to 8:00 PM EDT when the CLI declares a daily reset — the parser now preserves whether (resets daily) was actually present. Bare percentage output remains parseable but does not receive an inferred reset label or timestamp.
  • Preserves Amp Free alongside subscriptions — when a subscription is present, the free tier is no longer dropped. It is emitted as an extraRateWindows entry so it renders as a third usage row next to "Other usage" and "Orb usage".

Real behavior proof

The Amp dashboard shows that Amp Free resets daily at 8:00 PM EDT:

Amp Free dashboard showing “Resets daily at 8:00 PM EDT”

Changed files

  • Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift — month unit parsing and explicit daily-reset signal parsing
  • Sources/CodexBarCore/Providers/Amp/AmpUsageSnapshot.swift — 8 PM EDT reset and extraRateWindows Amp Free lane
  • Tests/CodexBarTests/AmpUsageParserTests.swift — month-based subscription, explicit daily reset, and ambiguous percentage regression coverage
  • Tests/CodexBarTests/UsageStoreCoverageTests.swift — subscription menu-model coverage including the Amp Free window

Test plan

  • swift test --filter AmpUsageParserTests — 20 Amp parser tests pass
  • make check — zero format/lint violations
  • make test — all 794 selections pass across 67 groups

- Parse 'resets upon renewal in N months' in addition to days
- Compute subscription reset date using Calendar month addition
- Set Amp Free 'resets daily' countdown to next 8:00 PM EDT
- Preserve Amp Free as an extraRateWindow alongside subscription pools
- Update tests for month-based renewal and 8 PM EDT reset
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 14, 2026, 3:13 AM ET / 07:13 UTC.

ClawSweeper review

What this changes

The PR parses Amp subscription renewals expressed in months, calculates explicit daily Amp Free resets in New York time, and shows Amp Free beside subscription usage pools.

Merge readiness

Blocked until stronger real behavior proof is added - 2 items remain

Keep open: the latest head resolves the prior menu-presentation blocker and has no confirmed code defect, but the supplied dashboard screenshot does not prove the after-fix CLI parse or CodexBar display.

Priority: P2
Reviewed head: bed2db5f36b12f1195c32e86397e2a617a67e96e

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and focused coverage look solid, but real after-fix behavior has not yet been demonstrated.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: The dashboard screenshot verifies the asserted reset schedule, but after-fix proof still needs a redacted real amp usage transcript and CodexBar card or status-menu result; redact account and other private data before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The dashboard screenshot verifies the asserted reset schedule, but after-fix proof still needs a redacted real amp usage transcript and CodexBar card or status-menu result; redact account and other private data before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Current main still has the parser gap: Current main and release v0.49.5 accept only days? in the subscription renewal pattern, so resets upon renewal in 1 month is not parsed.
Head implements the bounded parser and presentation path: The PR head accepts month units, uses calendar-month arithmetic, retains the free window as a named window, and selects it for the Amp status menu.
Focused regression coverage reaches both UI models: The head tests monthly parsing, New York daylight-saving boundaries, the extra Amp Free window, provider-card metrics, and the status-menu line.
Findings None None.
Security None None.

How this fits together

CodexBar obtains Amp usage from its CLI, API, or web fallback and translates the returned text into usage windows. Those windows feed the provider card and status menu that users consult for remaining quota and reset times.

flowchart LR
A[Amp CLI or API output] --> B[Usage parser]
B --> C[Amp usage snapshot]
C --> D[Provider presentation]
D --> E[Provider card]
D --> F[Status menu]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The dashboard screenshot verifies the asserted reset schedule, but after-fix proof still needs a redacted real amp usage transcript and CodexBar card or status-menu result; redact account and other private data before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The current screenshot proves Amp’s dashboard wording, not the PR’s after-fix parse or the resulting CodexBar menu/card behavior on a real account.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Implementation and coverage delta production +44/-9, tests/fixtures +108/-9, docs/release note +9/-4 The focused regression coverage is larger than the provider implementation and exercises parser plus presentation seams.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Add redacted evidence from a real monthly Amp account: the relevant amp usage output and a freshly built CodexBar capture showing Other usage, Orb usage, and Amp Free with the expected reset.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Add redacted evidence from a real monthly Amp account: the relevant amp usage output and a freshly built CodexBar capture showing Other usage, Orb usage, and Amp Free with the expected reset.

Do we have a high-confidence way to reproduce the issue?

Yes: current main’s subscription regex accepts only day units, so a real amp usage line ending in in 1 month follows a source-proven unsupported path. This review did not execute the account-bound CLI command.

Is this the best way to solve the issue?

Yes: the head preserves day handling while adding calendar-month handling and sends the retained free-tier window through existing provider-card and status-menu seams.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 40723c8274f6.

Labels

Label justifications:

  • P2: Current main and v0.49.5 ignore the new month-form Amp CLI renewal output, affecting Amp quota visibility without disrupting core application availability.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The dashboard screenshot verifies the asserted reset schedule, but after-fix proof still needs a redacted real amp usage transcript and CodexBar card or status-menu result; redact account and other private data before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The dashboard screenshot verifies the asserted reset schedule, but after-fix proof still needs a redacted real amp usage transcript and CodexBar card or status-menu result; redact account and other private data before posting.

Evidence

What I checked:

Likely related people:

  • steipete: Recently maintained the provider-descriptor architecture and authored the latest PR-head completion commit. (role: recent area contributor; confidence: high; commits: 973ec704de4d, bed2db5f36b1; files: Sources/CodexBarCore/Providers/Amp/AmpProviderDescriptor.swift, Sources/CodexBarCore/Providers/Amp/AmpUsageSnapshot.swift)
  • Tyler Gibbs: Introduced the existing Amp subscription parser and linked-subscription handling that this change extends. (role: introduced subscription behavior; confidence: high; commits: 322cfa790651, 0816bfe2dcf9; files: Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift, Sources/CodexBarCore/Providers/Amp/AmpUsageSnapshot.swift)
  • Echo: Previously repaired Amp Free fetching on current main history, adjacent to the daily-reset portion of this PR. (role: recent free-tier contributor; confidence: medium; commits: 7535638cc4dd; files: Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted real monthly-subscription amp usage output showing the month-form renewal and daily free-tier line.
  • Capture a freshly built CodexBar card or status menu showing Other usage, Orb usage, and Amp Free.
  • Update the PR body with that evidence; if a refresh does not occur, ask a maintainer to comment @clawsweeper re-review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (21 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-08T11:54:35.817Z sha ecb2bbf :: needs real behavior proof before merge. :: [P1] Expose the Amp Free lane through the status-menu presentation
  • reviewed 2026-08-08T13:47:22.063Z sha ecb2bbf :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-08T16:56:22.734Z sha ecb2bbf :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-08T17:10:34.373Z sha ecb2bbf :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-08T23:41:29.412Z sha ecb2bbf :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-09T04:55:20.581Z sha ecb2bbf :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-12T11:05:08.505Z sha ecb2bbf :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-12T12:35:13.881Z sha 1534b66 :: needs real behavior proof before merge. :: [P1] Expose the Amp Free window to the status menu

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 3, 2026
…s-monthly-and-free-tier-edt-reset

# Conflicts:
#	Sources/CodexBarCore/Providers/Amp/AmpUsageSnapshot.swift
#	Tests/CodexBarTests/UsageStoreCoverageTests.swift
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 6, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 7, 2026
@steipete
steipete merged commit a449749 into steipete:main Aug 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants