Skip to content

Handle claude-swap relogin status - #2446

Open
kiranmagic7 wants to merge 2 commits into
steipete:mainfrom
kiranmagic7:kiran/claude-swap-relogin-required-20260725
Open

Handle claude-swap relogin status#2446
kiranmagic7 wants to merge 2 commits into
steipete:mainfrom
kiranmagic7:kiran/claude-swap-relogin-required-20260725

Conversation

@kiranmagic7

Copy link
Copy Markdown
Contributor

Fixes #2444.

Problem

cswap 0.23.0 can report "usageStatus": "relogin_required" for an inactive account. CodexBar currently treats that value as unknown, so the account card shows the raw status instead of recovery guidance.

Change

  • Map relogin_required to a dedicated Claude swap usage status.
  • Show re-login guidance and keep the affected account non-activatable until its credentials are refreshed in claude-swap.
  • Cover the reported schema-v1 payload in parser, projection, and CLI card tests.

This does not change credential reading or account switching behavior.

Verification

  • swift test --filter ClaudeSwapListParserTests: the new regression failed before the implementation, then all 13 tests passed.
  • swift test --no-parallel --filter ClaudeSwap: 69 tests passed.
  • make check: passed (SwiftFormat: 0/1582 files; SwiftLint: 0 violations in 1581 files).
  • git diff --check: passed.
  • make test: stopped after its automatic retry because two unchanged AdaptiveRefreshTimerTests timed out with CancellationError() at 30 seconds:
    • menu open advances a long idle timer during refresh without postponing an earlier tick
    • coding activity advances a long idle timer without postponing an earlier tick

Both timer failures reproduce when that untouched suite runs alone.

Compatibility risk is low: this only changes handling for the newly recognized status string. Unknown future values still use the existing fallback.

Review focus: whether the recovery text and non-activatable state match the expected cswap behavior.

@clawsweeper clawsweeper Bot added 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. P2 Normal priority bug or improvement with limited blast radius. labels Jul 25, 2026
@clawsweeper

clawsweeper Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 29, 2026, 11:56 AM ET / 15:56 UTC.

ClawSweeper review

What this changes

The PR maps Claude Swap’s relogin_required JSON status to a typed account state, displays re-authentication guidance, prevents activation of that account, and adds parser, projection, and CLI-card coverage.

Merge readiness

Blocked until real behavior proof is added - 3 items remain

This PR is a focused candidate fix for the reported Claude Swap status-mapping bug and has no discrete correctness finding from the supplied diff. It should remain open because the contributor has not yet provided inspectable after-fix evidence from a real relogin_required Claude Swap account; fixture tests and checks are supplemental under this repository’s policy.

Priority: P2
Reviewed head: 24815a358bba8105ee3685cc69f28efaf39a2197

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is narrow and plausibly correct with focused tests, but it lacks the required real behavior proof for an external provider-status change.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: Focused fixture-backed tests are reported, but there is no inspectable after-fix run from a real Claude Swap relogin_required account. Add redacted terminal output or a visible CLI/account-state capture; redact account details, tokens, endpoints, and other private data. 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 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Focused fixture-backed tests are reported, but there is no inspectable after-fix run from a real Claude Swap relogin_required account. Add redacted terminal output or a visible CLI/account-state capture; redact account details, tokens, endpoints, and other private data. 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 4 items Focused patch surface: The supplied PR diff changes five Claude Swap parser, projection, and focused test files; it adds a dedicated reloginRequired state, recovery text, and a non-activatable projection.
Automated validation reported: The PR body reports 69 focused Claude Swap tests, parser regression coverage, make check, and diff-whitespace validation; these support the implementation but do not demonstrate live provider behavior.
Real proof remains absent: The contributor explicitly states they did not run a live Claude Swap account, Keychain, or provider probe, and the prior two ClawSweeper cycles requested redacted real behavior proof.
Findings None None.
Security None None.

How this fits together

CodexBar reads Claude Swap’s JSON account list, maps provider status strings into typed account state, and projects that state into account cards and CLI output. The projected state supplies recovery guidance and controls whether an account can be activated.

flowchart LR
    A[Claude Swap JSON account list] --> B[Status parser]
    B --> C[Typed usage status]
    C --> D[Account projection]
    D --> E[Account card and CLI output]
    D --> F[Activation eligibility]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Focused fixture-backed tests are reported, but there is no inspectable after-fix run from a real Claude Swap relogin_required account. Add redacted terminal output or a visible CLI/account-state capture; redact account details, tokens, endpoints, and other private data. 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) - Merging without redacted live evidence leaves uncertainty over whether Claude Swap’s real relogin_required payload produces the intended recovery guidance and disabled activation state in the user-facing path.
  • Complete next step (P2) - Contributor-provided real after-fix evidence is required before merge, and that evidence cannot be generated safely by an automated repair lane.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Focused patch size 32 added, 1 removed across 5 files The change is limited to Claude Swap status mapping, account projection, and focused regression tests.
Focused coverage 69 Claude Swap tests reported The reported focused suite provides useful regression coverage, but it cannot replace live after-fix behavior proof.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Obtain a redacted after-fix terminal capture or visible CodexBar CLI/account-state result from a real Claude Swap account reporting relogin_required, confirming the recovery message and non-activatable state before merging.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Obtain a redacted after-fix terminal capture or visible CodexBar CLI/account-state result from a real Claude Swap account reporting relogin_required, confirming the recovery message and non-activatable state before merging.

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

No high-confidence live reproduction was provided for this review. The JSON-to-projection path is clear from the supplied diff and issue context, but the contributor confirms no real Claude Swap account or provider probe was run.

Is this the best way to solve the issue?

Yes, the proposed typed status mapping and existing projection seam are the narrow maintainable solution for a newly recognized provider status. The remaining question is validation of the exact real-provider recovery behavior, not a different implementation direction.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs a bounded provider-status and account-recovery experience without evidence of an urgent outage or broad workflow failure.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Focused fixture-backed tests are reported, but there is no inspectable after-fix run from a real Claude Swap relogin_required account. Add redacted terminal output or a visible CLI/account-state capture; redact account details, tokens, endpoints, and other private data. 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

What I checked:

Likely related people:

  • steipete: Authored the current PR-head refinement that clarifies the Claude Swap re-login recovery guidance. (role: recent area contributor; confidence: medium; commits: 24815a358bba; files: Sources/CodexBarCore/Providers/Claude/ClaudeSwap/ClaudeSwapAccountProjection.swift)

Rank-up moves

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

  • Add a redacted live Claude Swap capture showing relogin_required and CodexBar’s resulting recovery text plus disabled activation state.
  • Update the PR body after adding proof to trigger a fresh ClawSweeper review; if it does not, 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 (2 earlier review cycles)
  • reviewed 2026-07-25T00:58:09.033Z sha 7b4932e :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-28T05:57:36.512Z sha 0813d36 :: needs real behavior proof before merge. :: none

@kiranmagic7

Copy link
Copy Markdown
Contributor Author

The failed macOS shard is outside this patch.

It reports 10 missing-totalCost assertions in the untouched SpendDashboardControllerTests; the aggregate gate is red only because that shard failed. I ran the workflow's exact four-suite selection at both revisions:

  • PR head 7b4932e2bb2ae6d4d3458ba149f04700d56377a1: reproduced the same 10 issues.
  • Untouched base cc8da27cec92029a6435bfee4a703a719290234e: reproduced the same 10 issues.

The branch diff remains limited to the five Claude Swap parser/projection/test files. The focused Claude Swap tests, make check, and git diff --check remain green.

GitHub rejected a failed-job rerun because the fork account does not have repository admin rights. Could a maintainer rerun the failed jobs?

The separate ClawSweeper request for redacted proof from a real relogin_required claude-swap setup remains open; fixture-backed tests are not being presented as live-account proof.

@kiranmagic7

Copy link
Copy Markdown
Contributor Author

Refreshed this branch onto current main now that #2418 landed. New head: 0813d366ef4673f8590ff5de8fc19ab55dbbf9d5. The effective PR diff remains the same five Claude Swap files (32 additions, 1 deletion).

Verification on the refreshed tree:

  • swift test --no-parallel --filter ClaudeSwap — 69 tests in 8 suites passed
  • shared spend-dashboard/status regression selection — 25 tests in 4 suites passed
  • make check
  • git diff --check origin/main...HEAD

Hosted checks are now running on the new head.

The separate request for redacted real relogin_required behavior proof remains open. I did not run a live claude-swap account, Keychain, or provider probe; repository guidance calls for fixture/stub testing unless that probe is explicitly requested.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 28, 2026
@steipete
steipete force-pushed the kiran/claude-swap-relogin-required-20260725 branch from 0813d36 to 24815a3 Compare July 29, 2026 15:52
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: 🧂 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude-swap: unrecognized usageStatus "relogin_required" from cswap 0.23.0

2 participants