Skip to content

Fix Claude sign-in menu state - #2445

Open
Zihao-Qi wants to merge 2 commits into
steipete:mainfrom
Zihao-Qi:codex/fix-claude-sign-in-label
Open

Fix Claude sign-in menu state#2445
Zihao-Qi wants to merge 2 commits into
steipete:mainfrom
Zihao-Qi:codex/fix-claude-sign-in-label

Conversation

@Zihao-Qi

@Zihao-Qi Zihao-Qi commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • show Switch Account... for authenticated Claude accounts
  • recognize successful email-less Claude OAuth snapshots as authenticated
  • keep Sign in with Claude Code... for signed-out accounts
  • preserve Claude-specific web re-login and terminal recovery actions
  • cover both account states through the shared MenuDescriptor seam

Root cause

The Claude provider-specific login action always returned Sign in with Claude Code..., bypassing the shared account-state logic. The first fix relied on account email, but successful Claude OAuth snapshots intentionally omit email even though they include provider-scoped identity and live quota windows.

The account detector now treats only a Claude-scoped identity with real rate-limit data as authenticated, so an empty or cross-provider snapshot cannot suppress the sign-in action.

This is a focused follow-up to #1811. It does not change Claude authentication or multi-account behavior.

Validation

  • swift test --filter ClaudeWebRecoveryMenuTests
  • make check
  • make test attempted; it repeats the pre-existing failures in ClaudeOAuthCredentialsStoreTemporaryKeychainCacheTests that also reproduce on upstream before this change

@Zihao-Qi
Zihao-Qi marked this pull request as ready for review July 24, 2026 23:34

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64835152dd

ℹ️ 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".

@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. merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. 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 24, 2026, 8:11 PM ET / July 25, 2026, 00:11 UTC.

ClawSweeper review

What this changes

The PR changes Claude’s menu action so authenticated accounts use the shared “Switch Account…” action while signed-out accounts keep the Claude Code sign-in action.

Merge readiness

Blocked until real behavior proof from a real setup is added - 5 items remain

Keep this PR open: the proposed guard still treats a successful Claude OAuth session without an account email as signed out, so it does not fix the central authenticated-menu case. The preceding Claude sign-in flow was introduced by #1811; likely related people: steipete (medium confidence, prior feature author).

Priority: P2
Reviewed head: 64835152dd1cfad449435b0d8f884c3dc009b17b

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and includes a useful regression test, but it misses an OAuth identity case and lacks real after-fix behavior proof.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports focused tests and checks but provides no after-fix menu run, terminal transcript, recording, or redacted runtime log. Before merge, add real proof showing Switch Account... for a signed-in Claude session and the Claude Code sign-in action when signed out, with account details redacted. 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) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports focused tests and checks but provides no after-fix menu run, terminal transcript, recording, or redacted runtime log. Before merge, add real proof showing Switch Account... for a signed-in Claude session and the Claude Code sign-in action when signed out, with account details redacted. 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 OAuth regression remains: The supplied review comment identifies that successful Claude OAuth snapshots may have accountEmail: nil; the PR forwards the existing email-derived hasAccount into the Claude override, so that authenticated case still renders the Claude Code sign-in action.
Patch scope: The PR changes four files: shared menu login context, the Claude override, menu-context construction, and focused Claude menu tests.
Feature provenance: The supplied related-item record shows that the merged Claude sign-in flow was introduced in the earlier PR and its merge commit; this PR is a follow-up in the same menu-action area.
Findings 1 actionable finding [P2] Treat email-less OAuth snapshots as signed in
Security None None.

How this fits together

CodexBar’s provider menu turns a provider usage snapshot and recovery state into account actions in the macOS menu bar. Claude can override the shared action for web re-login or terminal recovery, and otherwise should defer to the account-state result.

flowchart LR
    A[Claude usage snapshot] --> B[Provider identity state]
    C[Claude recovery errors] --> D[Claude menu override]
    B --> E[Shared account-state decision]
    D --> F[Menu action selection]
    E --> F
    F --> G[Menu bar account action]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports focused tests and checks but provides no after-fix menu run, terminal transcript, recording, or redacted runtime log. Before merge, add real proof showing Switch Account... for a signed-in Claude session and the Claude Code sign-in action when signed out, with account details redacted. 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.
  • Treat email-less OAuth snapshots as signed in (P2) - Claude OAuth usage snapshots can represent a successful authenticated session without accountEmail. This guard receives the existing email-derived state, so those users still see Sign in with Claude Code...; derive the state from provider-scoped authenticated identity or successful snapshot evidence and add that regression case.
  • Resolve merge risk (P1) - Merging as written leaves email-less but successful Claude OAuth sessions on the misleading sign-in action.
  • Resolve merge risk (P1) - The PR body reports tests and checks but has no redacted after-fix runtime evidence for the two menu states; an automated repair cannot prove the contributor’s real setup.
  • Complete next step (P2) - The code defect is narrowly identified, but the contributor must also provide real behavior proof that automation cannot obtain from the PR branch.

Findings

  • [P2] Treat email-less OAuth snapshots as signed in — Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift:302
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch scope 4 files changed; 31 additions, 2 deletions The implementation is narrowly scoped to menu-state propagation and focused regression coverage.

Merge-risk options

Maintainer options:

  1. Correct OAuth account-state detection (recommended)
    Use provider-scoped authenticated snapshot evidence for the Claude menu decision, retain recovery overrides, and add a regression test for a successful OAuth identity without an email.
  2. Pause the change
    Leave the current sign-in behavior in place until the intended account-state contract for email-less Claude OAuth snapshots is confirmed.

Technical review

Best possible solution:

Derive Claude’s authenticated menu state from provider-scoped successful identity/snapshot evidence rather than an email alone, cover email-backed and email-less OAuth identities, then attach redacted fresh-bundle proof of both signed-in and signed-out menu actions.

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

Yes, from source evidence: a successful Claude OAuth snapshot can lack an account email, while the patch uses an email-derived account flag to suppress the sign-in action. I could not execute a local reproduction because the restricted read-only shell failed before running any command.

Is this the best way to solve the issue?

No: the patch covers an authenticated fixture with an email but misses the email-less OAuth identity path described in the review evidence. A provider-scoped authenticated-state predicate is the narrower durable fix.

Full review comments:

  • [P2] Treat email-less OAuth snapshots as signed in — Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift:302
    Claude OAuth usage snapshots can represent a successful authenticated session without accountEmail. This guard receives the existing email-derived state, so those users still see Sign in with Claude Code...; derive the state from provider-scoped authenticated identity or successful snapshot evidence and add that regression case.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a limited but user-visible Claude account-menu correctness problem rather than a service outage or security boundary failure.
  • add merge-risk: 🚨 auth-provider: The patch changes how Claude authenticated state selects account actions, and the remaining OAuth identity case can misroute signed-in users to sign-in recovery.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests and checks but provides no after-fix menu run, terminal transcript, recording, or redacted runtime log. Before merge, add real proof showing Switch Account... for a signed-in Claude session and the Claude Code sign-in action when signed out, with account details redacted. 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.

Label justifications:

  • P2: This is a limited but user-visible Claude account-menu correctness problem rather than a service outage or security boundary failure.
  • merge-risk: 🚨 auth-provider: The patch changes how Claude authenticated state selects account actions, and the remaining OAuth identity case can misroute signed-in users to sign-in recovery.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish 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: The PR body reports focused tests and checks but provides no after-fix menu run, terminal transcript, recording, or redacted runtime log. Before merge, add real proof showing Switch Account... for a signed-in Claude session and the Claude Code sign-in action when signed out, with account details redacted. 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 and merged the preceding Claude Code sign-in flow, which established the provider-specific menu action this PR modifies. (role: prior feature author; confidence: medium; commits: 30b476237588; files: Sources/CodexBar/MenuDescriptor.swift, Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift)

Rank-up moves

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

  • Update the authenticated-state decision and add an email-less OAuth identity regression test.
  • Attach redacted runtime evidence for both signed-in and signed-out Claude menu states.

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.

@Zihao-Qi

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 25, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper

clawsweeper Bot commented Jul 25, 2026

Copy link
Copy Markdown

ClawSweeper status: review started.

I am starting a fresh review of this pull request: Fix Claude sign-in menu state This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. P2 Normal priority bug or improvement with limited blast radius. 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.

1 participant