fix(cli): honor --json on billing manage + logout, self-revoke on logout (AIT-164, AIT-153) - #16
Conversation
…out (AIT-164, AIT-153)
`billing manage --json` printed human text and opened a browser instead of
emitting JSON; `logout --json` printed the human check line. Both broke the
--json machine contract (a side effect + no clean JSON).
- billing manage --json now emits { billingUrl } and opens no browser.
- logout --json now emits { status, revoked } instead of the human line.
- logout now best-effort revokes an agent credential server-side (DELETE
/agent/credentials/:publicId) before clearing local credentials, so an
API key can't keep being used after logout (AIT-153). Best-effort: an
offline host or already-revoked key still clears local credentials. WorkOS
sessions have no CLI-side revoke and are unaffected.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…out (AIT-164, AIT-153) (#16) `billing manage --json` printed human text and opened a browser instead of emitting JSON; `logout --json` printed the human check line. Both broke the --json machine contract (a side effect + no clean JSON). - billing manage --json now emits { billingUrl } and opens no browser. - logout --json now emits { status, revoked } instead of the human line. - logout now best-effort revokes an agent credential server-side (DELETE /agent/credentials/:publicId) before clearing local credentials, so an API key can't keep being used after logout (AIT-153). Best-effort: an offline host or already-revoked key still clears local credentials. WorkOS sessions have no CLI-side revoke and are unaffected.
Problem (AIT-164)
The
--jsoncontract is a machine interface: emit valid JSON and take nointeractive side effect. Two commands broke it:
billing manage --jsonprinted human text (Opening your Billing page...)AND opened a browser.
logout --jsonprinted✓ Logged outinstead of JSON.billing upgrade --jsonwas already correct (guards on--json) and is thereference pattern.
Changes
billing manage --jsonnow emits{ "billingUrl": "..." }and opens nobrowser.
logout --jsonnow emits{ "status": "logged_out", "revoked": <bool> }instead of the human line.
logoutnow best-effort revokes an agent credentialserver-side (
DELETE /agent/credentials/:publicId, the backend'sagent self-revoke route) before clearing local credentials, so a leaked/idle
API key can't keep being used after logout. Best-effort: an offline host or
an already-revoked key still clears local credentials. WorkOS user sessions
carry no CLI-side revoke and are unchanged.
Sweep
Audited every browser-open / interactive side effect:
channels connectandbilling upgradealready guard--json;login's browser open is the authhandshake itself (inherently interactive).
billing managewas the onlyremaining side-effect-in-json offender.
Verification
billing manage --jsonemits URL + opens nothing;logout --jsonemits JSON and suppresses the human line; agent-credential logout calls the
self-revoke endpoint; revoke failure still clears local creds.
tsc --noEmitclean, build succeeds.