Skip to content

Parse the new Amp <plan> Subscription CLI line format - #3057

Merged
steipete merged 4 commits into
mainfrom
codex-3050
Aug 19, 2026
Merged

Parse the new Amp <plan> Subscription CLI line format#3057
steipete merged 4 commits into
mainfrom
codex-3050

Conversation

@steipete

Copy link
Copy Markdown
Owner

Summary

Fixes #3050. Amp CLI 0.0.1786838506 changed its signed-in usage line from Subscription <plan>: ... to Amp <plan> Subscription: ..., so the CLI source parsed "successfully" but dropped the monthly Other/Orb usage windows — codexbar usage --provider amp --source cli returned primary: null / secondary: null with only the Credits detail row.

The parser now accepts both line shapes, keeps plan extraction (Megawatt), preserves the existing monthly-reset representation for in 1 month, and leaves Individual credits as a details row.

Test plan

  • 38 focused Amp tests pass, including exact fixtures for both the new and legacy formats
  • make check clean

@clawsweeper

clawsweeper Bot commented Aug 18, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 18, 2026
@clawsweeper

clawsweeper Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 7:37 PM ET / 23:37 UTC.

ClawSweeper review

What this changes

The PR extends Amp CLI usage parsing to recognize Amp &lt;plan> Subscription: while retaining the legacy subscription-line format and adds exact regression coverage.

Regression provenance

Possible regression — probable (failure trace; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this maintainer-authored PR open for normal merge review. The checked-out parser accepts both the current and legacy Amp subscription lines, and focused tests cover the reported output with no correctness finding; the remaining build/test jobs should complete before landing.

Priority: P2
Reviewed head: bc0dbaaaaeb1c56020e458d91a914c39e8d8e56c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused, compatibility-preserving patch and direct fixtures are good merge-quality evidence, subject to completion of the running checks.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is outside the external-contributor real-behavior-proof gate; the body also reports focused parser tests and a clean check.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is outside the external-contributor real-behavior-proof gate; the body also reports focused parser tests and a clean check.
Evidence reviewed 5 items Dual-format parser: The parser shares the subscription suffix and accepts both legacy Subscription &lt;plan>: and current Amp &lt;plan> Subscription: prefixes.
Usage mapping preserved: A matched subscription still produces plan identity, monthly primary/secondary usage, and reset metadata through the existing snapshot mapping.
Current-format regression coverage: The new fixture asserts the reported Megawatt line restores both usage lanes, monthly reset date, plan identity, and individual-credit detail.
Findings None None.
Security None None.

Live Verification

Command: swift test --filter AmpUsageParserTests

Result: FAIL (failed) — execution before step 1 run: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

Assertions:

  • FAIL expect_output: AmpUsageParserTests

How this fits together

CodexBar’s Amp provider runs the signed-in Amp CLI and parses its text into a usage snapshot. That snapshot supplies the CLI and menu-bar usage lanes, plan identity, reset date, and credits detail row.

flowchart LR
A[Amp CLI output] --> B[Amp CLI probe]
B --> C[Amp usage parser]
C --> D[Subscription format match]
D --> E[Usage snapshot]
E --> F[CLI and menu-bar views]
Loading

Before merge

  • Resolve merge risk (P1) - The remaining GitHub build and test jobs were still in progress and should gate landing of this exact head.
  • Complete next step (P2) - Await the in-progress build and test results; no narrow automated repair is indicated.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Focused parser coverage production +17/-11, tests +23/-1 The implementation is a small compatibility adjustment with direct fixtures for both known line formats.
Changed surface 3 files affected The patch is limited to the parser, its focused tests, and an unreleased release note.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the narrow dual-format parser after the current checks pass, preserving the legacy grammar until Amp’s CLI contract is stable.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the narrow dual-format parser after the current checks pass, preserving the legacy grammar until Amp’s CLI contract is stable.

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

Yes—source-reproducible. The supplied current Amp CLI transcript is encoded as an exact parser test, and the PR patch shows the prior grammar only accepted the legacy prefix; this read-only review did not execute tests.

Is this the best way to solve the issue?

Yes. Matching the two known prefixes through one shared suffix is the narrowest compatibility-preserving repair and keeps the established legacy path covered.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8637c5d65b9a.

Labels

Label justifications:

  • P2: This repairs missing Amp subscription usage windows for affected CLI users without evidence of broader service disruption.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is outside the external-contributor real-behavior-proof gate; the body also reports focused parser tests and a clean check.

Evidence

What I checked:

Likely related people:

  • steipete: Available blame assigns the relevant parser lines to Peter Steinberger at the checked-out head, and the supplied PR history identifies steipete as the author of the focused repair. (role: current parser-line author in available history; confidence: medium; commits: 43b12b3fa326, bc0dbaaaaeb1; files: Sources/CodexBarCore/Providers/Amp/AmpUsageParser.swift, Tests/CodexBarTests/AmpUsageParserTests.swift)

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 (2 earlier review cycles)
  • reviewed 2026-08-18T22:20:10.568Z sha 43b12b3 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-18T23:28:08.021Z sha 754ec68 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit bed9219 into main Aug 19, 2026
9 checks passed
steipete added a commit that referenced this pull request Aug 19, 2026
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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Amp Megawatt line format drifted: Amp Megawatt Subscription: no longer matches Subscription <plan>: parser

1 participant