Skip to content

Add re-authenticate actions for Codex/Kiro, and a background-repair toggle for Claude - #2340

Closed
Vit129 wants to merge 8 commits into
steipete:mainfrom
Vit129:pr-reauth-buttons
Closed

Add re-authenticate actions for Codex/Kiro, and a background-repair toggle for Claude#2340
Vit129 wants to merge 8 commits into
steipete:mainfrom
Vit129:pr-reauth-buttons

Conversation

@Vit129

@Vit129 Vit129 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Claude: adds a Settings > Advanced > Privacy toggle ("Auto-repair expired Claude token") that lets the existing delegated-refresh mechanism re-prompt the Keychain in the background, instead of requiring a manual Refresh click every time claudeOAuthKeychainPromptMode is onlyOnUserAction (the default) and the token expires.
  • Codex: adds a "Re-authenticate" button in Settings > Codex > Connection, wired to the existing runLoginFlow -> CodexLoginRunner -> codex login path already used elsewhere (e.g. Switch Account). Previously the only recovery from an expired Codex OAuth token was running codex login manually in a terminal.
  • Kiro: adds the equivalent "Re-authenticate" button, backed by a new KiroLoginRunner that spawns kiro-cli login (mirrors CodexLoginRunner's subprocess-lifecycle handling) and a new BinaryLocator.resolveKiroCLIBinary (mirrors resolveAntigravityBinary). Antigravity already has an equivalent flow ("Login with Google"); this brings Codex and Kiro to parity with it.

Test plan

  • swift build --product CodexBar -c debug succeeds
  • Manual: Settings > Advanced toggle flips claudeOAuthKeychainPromptMode between onlyOnUserAction and always
  • Manual: Codex/Kiro "Re-authenticate" buttons launch their respective CLI login flows and refresh usage on success

@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: 883624f090

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

stdoutCapture.start()
stderrCapture.start()

let timedOut = await self.wait(timeout: timeout, termination: termination)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Surface Kiro device-flow output before waiting

When kiro-cli login uses device flow (the documented fallback for remote/browser-doesn't-open cases, where it prints a device code/URL and then polls), this waits for the subprocess to exit or hit the 120s timeout before combinedOutput is ever shown to the user. In that scenario the user never sees the code while the CLI is still polling, so the new Re-authenticate action times out and kills the login instead of letting them complete it; stream/detect the URL as it appears or run the login in a terminal/PTY.

Useful? React with 👍 / 👎.

@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. labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 16, 2026, 7:37 AM ET / 11:37 UTC.

ClawSweeper review

What this changes

The branch adds a Kiro CLI reauthentication flow, a global Codex settings reauthentication action, supporting process helpers, localized copy, and Kiro runner tests.

Merge readiness

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

Keep open: the branch still adds a global Codex reauthentication action that bypasses the existing account-scoped flow, and its manual-test descriptions are not inspectable real-behavior proof.

Priority: P2
Reviewed head: edfca2829c8cd647c8a72d48b9a2a456cb79ef23

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The Kiro runner and focused tests show useful implementation work, but the unresolved Codex ownership defect and missing inspectable proof prevent merge readiness.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: Manual-test comments describe the flows but provide no inspectable redacted after-fix artifact, and Kiro success plus refreshed usage was not freshly demonstrated. 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 stronger real behavior proof before merge: Manual-test comments describe the flows but provide no inspectable redacted after-fix artifact, and Kiro success plus refreshed usage was not freshly demonstrated. 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 6 items Account-scoped Codex implementation: Current main routes managed-account reauthentication through the selected stored account ID, then refreshes Codex usage.
Managed-home boundary: The managed login runner supplies a dedicated home path to CodexLoginRunner, preserving each managed account’s credential scope.
Global action bypasses the selected account: The proposed Codex settings row calls the generic login closure, which reaches the ambient Codex login path without a managed home or selected account ID.
Findings 1 actionable finding [P1] Remove the global Codex reauthentication action
Security None None.

How this fits together

Provider settings invoke provider-specific login flows and refresh usage afterward. Codex has managed and ambient accounts with separate authentication ownership, while Kiro depends on its locally installed CLI for Builder ID authentication.

flowchart LR
A[Provider settings] --> B[Login action]
B --> C[Provider-specific runner]
C --> D[CLI and browser authentication]
D --> E[Credential storage]
E --> F[Usage refresh]
G[Managed Codex account] --> H[Account-scoped login]
H --> E
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Manual-test comments describe the flows but provide no inspectable redacted after-fix artifact, and Kiro success plus refreshed usage was not freshly demonstrated. 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.
  • Remove the global Codex reauthentication action (P1) - This action always calls the generic settings login flow, which reaches the ambient CodexLoginRunner without the selected managed account’s home path. The existing account section reauthenticates a managed account through authenticateManagedAccount(existingAccountID:); keeping both lets this button report success while the selected account remains expired. This repeats the prior P1 finding.
  • Resolve merge risk (P1) - Merging the global Codex button can authenticate the ambient Codex home while leaving the selected managed account expired.
  • Resolve merge risk (P1) - The branch still lacks inspectable after-fix evidence for successful Codex and Kiro login recovery and post-login usage refresh.
  • Complete next step (P2) - A narrow mechanical repair can remove the conflicting Codex action, but contributor-supplied real behavior proof remains required before merge.

Findings

  • [P1] Remove the global Codex reauthentication action — Sources/CodexBar/Providers/Codex/CodexProviderImplementation.swift:74-76
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test delta production +378, tests +127 Most of the 505 added lines implement a new external-login runner, so the account-ownership boundary and live proof deserve review.
Files affected 9 files changed The change spans settings UI, provider login dispatch, process capture, CLI discovery, localization, and tests.

Merge-risk options

Maintainer options:

  1. Preserve account-scoped Codex login (recommended)
    Remove the global Codex settings action so reauthentication continues through the selected account’s managed or ambient control.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Remove the global Codex settings action and its Codex-only strings; add focused regression coverage that Codex reauthentication remains account-scoped.

Technical review

Best possible solution:

Keep Codex reauthentication on its existing per-account controls, then land the Kiro flow only after redacted proof shows a successful live login and refreshed Kiro usage.

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

Yes—source provides a high-confidence path: configure a managed Codex account and invoke the proposed global settings action; it reaches ambient login rather than the selected account’s scoped runner. This review did not execute the path because the checkout is read-only.

Is this the best way to solve the issue?

No—the Codex portion is not the best solution because current account controls already preserve managed versus ambient ownership; remove the global action and retain the Kiro-specific addition.

Full review comments:

  • [P1] Remove the global Codex reauthentication action — Sources/CodexBar/Providers/Codex/CodexProviderImplementation.swift:74-76
    This action always calls the generic settings login flow, which reaches the ambient CodexLoginRunner without the selected managed account’s home path. The existing account section reauthenticates a managed account through authenticateManagedAccount(existingAccountID:); keeping both lets this button report success while the selected account remains expired. This repeats the prior P1 finding.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded provider-authentication feature with a concrete compatibility blocker, not an immediate availability or data-loss incident.
  • merge-risk: 🚨 compatibility: A new global Codex action conflicts with the established managed-account reauthentication path and can act on a different account scope.
  • merge-risk: 🚨 auth-provider: The affected flow writes or refreshes OAuth credentials through the Codex and Kiro command-line clients.
  • 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 stronger real behavior proof before merge: Manual-test comments describe the flows but provide no inspectable redacted after-fix artifact, and Kiro success plus refreshed usage was not freshly demonstrated. 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

Acceptance criteria:

  • [P1] swift test --filter ProviderSettingsDescriptorTests.
  • [P1] swift test --filter CodexAccountsSettingsSectionTests.
  • [P1] make check.

What I checked:

Likely related people:

  • steipete: Current source attribution identifies Peter Steinberger on the Codex account surface, and the repository owner reviewed this PR’s requested proof and authored its latest merge-head commit. (role: recent area contributor and reviewer; confidence: medium; commits: 0e453c4a5b2a, edfca2829c8c; files: Sources/CodexBar/PreferencesProvidersPane.swift, Sources/CodexBar/ManagedCodexAccountService.swift, Sources/CodexBar/Providers/Codex/CodexLoginFlow.swift)

Rank-up moves

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

  • Remove the global Codex settings row and retain account-scoped reauthentication.
  • Attach redacted terminal output, runtime logs, or a recording showing successful Codex and Kiro recovery plus usage refresh.

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 (14 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-03T11:47:10.583Z sha ce6991e :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-03T13:53:53.447Z sha ce6991e :: needs real behavior proof before merge. :: [P1] Remove the duplicate Claude prompt-policy toggle
  • reviewed 2026-08-03T15:55:55.765Z sha ce6991e :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-03T19:00:34.735Z sha ce6991e :: needs real behavior proof before merge. :: [P1] Remove the duplicate Claude prompt-policy toggle
  • reviewed 2026-08-04T05:03:17.991Z sha 532d45d :: needs real behavior proof before merge. :: [P1] Keep Codex reauthentication account-scoped
  • reviewed 2026-08-05T08:22:32.224Z sha 76c12ef :: needs real behavior proof before merge. :: [P1] Keep Codex reauthentication account-scoped
  • reviewed 2026-08-11T01:04:47.283Z sha 76c12ef :: needs real behavior proof before merge. :: [P1] Use the account-scoped Codex reauthentication path
  • reviewed 2026-08-12T09:13:47.195Z sha 76c12ef :: needs real behavior proof before merge. :: [P1] Remove the global Codex reauthentication action

Vit129 added a commit to Vit129/CodexBar that referenced this pull request Aug 1, 2026
Addresses clawsweeper P2 finding on steipete#2340: KiroLoginRunner only returned
its captured output once the kiro-cli subprocess exited, but a
device-flow login prints its URL and one-time code while still polling
for browser approval, so the Settings action never showed it before the
120s timeout killed the login.

Adds a live poll of the still-running subprocess's pipes for a
device-flow URL and surfaces it as soon as it appears via an onProgress
callback, instead of waiting for process completion.
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. label Aug 1, 2026
Vit129 added a commit to Vit129/CodexBar that referenced this pull request Aug 1, 2026
Addresses clawsweeper P2 finding on steipete#2340: KiroProviderImplementation
returned true unconditionally, so the shared login contract refreshed
usage even after a missing CLI, timeout, failed login, or cancellation.
runKiroLoginFlow now returns the actual outcome.
Vit129 added a commit to Vit129/CodexBar that referenced this pull request Aug 2, 2026
Addresses clawsweeper P2 finding on steipete#2340: KiroLoginRunner only returned
its captured output once the kiro-cli subprocess exited, but a
device-flow login prints its URL and one-time code while still polling
for browser approval, so the Settings action never showed it before the
120s timeout killed the login.

Adds a live poll of the still-running subprocess's pipes for a
device-flow URL and surfaces it as soon as it appears via an onProgress
callback, instead of waiting for process completion.
Vit129 added a commit to Vit129/CodexBar that referenced this pull request Aug 2, 2026
Addresses clawsweeper P2 finding on steipete#2340: KiroProviderImplementation
returned true unconditionally, so the shared login contract refreshed
usage even after a missing CLI, timeout, failed login, or cancellation.
runKiroLoginFlow now returns the actual outcome.
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. label Aug 4, 2026
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Thanks for the re-authenticate actions and the background-repair toggle — both address real friction. The branch has had failing checks since mid-July and the review still asks for real-behavior proof of the new auth flows. Could you rebase on current main, get CI green, and add that proof within the next two weeks? Then it can move back into active review.

Vit129 and others added 7 commits August 5, 2026 15:13
Previously the only way to change claudeOAuthKeychainPromptMode away
from onlyOnUserAction was a defaults write — users hitting "background
repair is suppressed... Click Refresh" had no in-app way to opt into
always-on background repair. Adds a Privacy-section toggle in Advanced
settings wrapping the existing mode as a simple on/off (always vs
onlyOnUserAction), leaving the never/prompt-free path untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HzWPve8BJ9KqMcSBiGXzPN
Codex had no settings action to recover from an expired OAuth token
short of running \`codex login\` manually in a terminal. Adds a
settingsActions entry (same pattern already used by Antigravity's
"Login with Google" button) that calls the existing runLoginFlow ->
CodexLoginRunner -> \`codex login\` subprocess path.

Antigravity already exposes an equivalent button ("Login with Google" /
"Add Google Account" in Settings > Antigravity > Connection) wired to a
real browser OAuth flow via AntigravityLoginRunner — no change needed
there. Kiro has no CLI login/auth surface in its \`kiro\` binary
(confirmed via \`kiro --help\`: file/diff/chat/tunnel commands only, no
login or auth subcommand), so no button was added for it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HzWPve8BJ9KqMcSBiGXzPN
Earlier claim that Kiro has no CLI login was wrong — it was tested
against \`kiro\` (the editor launcher), not \`kiro-cli\` (a separate
binary at ~/.local/bin/kiro-cli). \`kiro-cli login\` opens a real
browser OAuth flow and blocks until it completes, same shape as
\`codex login\`.

Adds BinaryLocator.resolveKiroCLIBinary (mirrors resolveAntigravityBinary)
and KiroLoginRunner (mirrors CodexLoginRunner's subprocess-lifecycle
handling) to wire a settingsActions "Re-authenticate" button through
the existing runLoginFlow -> StatusItemController path already used by
Codex and Antigravity.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HzWPve8BJ9KqMcSBiGXzPN
Addresses clawsweeper P2 finding on steipete#2340: KiroLoginRunner only returned
its captured output once the kiro-cli subprocess exited, but a
device-flow login prints its URL and one-time code while still polling
for browser approval, so the Settings action never showed it before the
120s timeout killed the login.

Adds a live poll of the still-running subprocess's pipes for a
device-flow URL and surfaces it as soon as it appears via an onProgress
callback, instead of waiting for process completion.
Addresses clawsweeper P2 finding on steipete#2340: KiroProviderImplementation
returned true unconditionally, so the shared login contract refreshed
usage even after a missing CLI, timeout, failed login, or cancellation.
runKiroLoginFlow now returns the actual outcome.
Mirrors CodexLoginRunnerTests' process-lifecycle coverage for the new
subprocess runner, which previously shipped with no test changes.
The Advanced pane's Boolean toggle wrote the same
claudeOAuthKeychainPromptMode preference as the existing three-mode
picker in Provider settings, but couldn't represent "Never prompt" -
two controls, conflicting semantics.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018gG6Sz5aaJw2vbT2DSgtJU
@Vit129
Vit129 force-pushed the pr-reauth-buttons branch from 532d45d to 76c12ef Compare August 5, 2026 08:18
@Vit129

Vit129 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (was 50 commits behind) — clean, no conflicts. swift build passes.

Ran the tests covering the three new flows locally (CodexLoginRunnerTests, KiroLoginRunnerTests, ClaudeOAuthCredentialsStorePromptPolicyTests): 18/18 passing — timeout handling, output-drain bounding, device-flow URL/code surfacing, and Claude's prompt-mode gating (onlyOnUserAction vs always) all covered.

Pushed the rebase (76c12ef6). Looks like the new CI run is sitting on action_required — needs approval to kick off.

Still working through the two remaining manual checklist items (Settings toggle flip + live Codex/Kiro re-authenticate click) and will follow up with results.

@Vit129

Vit129 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Manual test plan results:

  • Claude toggle: flipped Settings > Advanced > Privacy > "Auto-repair expired Claude token" on — confirmed claudeOAuthKeychainPromptMode actually changes from onlyOnUserAction to always (defaults read com.steipete.codexbar claudeOAuthKeychainPromptMode).
  • Codex re-authenticate: clicked Settings > Codex > Connection > Re-authenticate — codex login flow launched and completed successfully, usage refreshed.
  • Kiro re-authenticate: clicked Settings > Kiro > Re-authenticate while already logged in — got kiro-cli login's own guard ("Already logged in, please logout with kiro-cli logout first") surfaced verbatim in the alert, exactly matching KiroLoginAlertPresentation's .failed case. Confirms the subprocess spawn → stderr capture → alert plumbing works end to end; this particular run just hit kiro-cli's own already-logged-in guard rather than an expired token. The success path (kiro-cli logout then re-authenticate) has been exercised in earlier local testing before this PR was opened; didn't have a free login slot to redo it live for this comment but happy to if you want a fresh recording.

CI is still sitting on action_required on your end.

@clawsweeper clawsweeper Bot added 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. labels Aug 11, 2026
@Vit129

Vit129 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Closing this out for now — not planning to continue addressing the review feedback (the account-scoped Codex reauth fix and fresh proof) in the near term. Thanks for the review time either way; may reopen a focused follow-up later.

@steipete

Copy link
Copy Markdown
Owner

Thanks @Vit129! This landed via #2980, which preserves your Kiro re-authenticate work (device-flow progress, bounded teardown, failure presentation) with full locale coverage. Two pieces were intentionally not carried over after review: the Claude background auto-repair boolean (it duplicated the existing three-mode Keychain prompt policy and could effectively turn an explicit Never into Always — the policy modes remain the way to opt into background prompting) and the global Codex re-auth button (it used the ambient Codex home and could report success while the selected managed account stayed expired; the account-scoped re-auth rows already cover this). Closing as superseded, with credit in the changelog.

Finesssee added a commit to nesszer/Win-CodexBar that referenced this pull request Aug 18, 2026
Finesssee added a commit to nesszer/Win-CodexBar that referenced this pull request Aug 18, 2026
Finesssee added a commit to nesszer/Win-CodexBar that referenced this pull request Aug 18, 2026
* Port upstream 0.50.1: Cursor rename + Ollama cookie stripping (steipete#2951, steipete#2949)

* Port upstream 0.50.1: OpenCode Go session+weekly pace in CLI (steipete#2957)

* Port upstream 0.50.1: chart axis label centering (steipete#2974)

* Port upstream 0.50.1: Kiro re-authenticate via kiro-cli login (steipete#2340)

* Port upstream 0.50.1: serve identity follows app redaction per-request (steipete#2960)

* Port upstream 0.50.1: Codex routed pricing, auth.json read-only, known-zero history, Antigravity dashboard lanes, Claude OAuth revoked detection

steipete#2946 Codex routed models pricing — codex_routed_provider() + strip_route_prefix()
    in cost_pricing.rs; deepseek/, kimi/, opencode/ routes price against
    matching models.dev provider; unknown provider/ prefixes return None.
steipete#2944 Codex auth.json read-only during refresh — codex_external_oauth_sources_allowed
    setting (default OFF); is_external_oauth + last_refresh fields on
    CodexCredentials; enforce_external_oauth_gate (8-day staleness window).
steipete#2932 Codex known-zero history — known_zero field on CostSummary; set in both
    cache-debounce and full-scan paths (history_coverage_established &&
    sessions_count == 0); knownZero JSON field + CLI text update.
steipete#2963 Antigravity dashboard lanes — quota-bucket dedup in parse_user_status;
    models sharing the same (remaining_fraction, reset_time) collapse to one
    lane.
steipete#2516 Claude revoked vs missing OAuth — ProviderError::OAuthRevoked variant;
    revocation detection (401/403 with revoked/invalid_grant/token_revoked);
    15-min CLI result cache (LazyLock<Mutex<Option<CachedCliResult>>>);
    fetch_via_auto returns cached CLI result when OAuth revoked, and stale
    cache when all live sources fail.

* Port upstream 0.50.1: Mistral PAYG spend, cost-summary display style, per-provider accent color

Item 1 — Mistral PAYG current-month API spend (steipete#2821, steipete#2947):
- Add MonthlyPlan variant to MetricPreference enum
- Add currency_symbol field to CostSnapshot with with_currency_symbol builder
- Set currency_symbol from Mistral billing API response
- Add MonthlyPlan to bridge label/parse, tray selected_metric_percent (None = no bar)
- Show formatted cost amount in provider_status_label for MonthlyPlan
- Add format_cost_amount helper in bridge.rs
- Add Mistral monthly spend row in MenuCardDetails
- Add monthlyPlan option to MenuBarMetricSection for Mistral

Item 2 — Menu cost-summary display style per provider (steipete#2976):
- Add CostSummaryDisplayStyle enum (Compact/Detailed/Hidden) in types.rs
- Add cost_summary_display_style field to Settings + Default + RawSettings round-trip
- Add to SettingsSnapshot bridge + SettingsUpdate + apply in Tauri commands
- Add bridge label/parse functions
- Apply in MenuCardDetails: hidden hides cost section, compact shows used/limit only
- Update describeCard to filter hasCost for hidden style
- Add Select control in UsageSpendTab

Item 3 — Per-provider accent color override (steipete#2972):
- Add accent_color field to ProviderConfig
- Add brand_color(ProviderId) function in provider.rs (mirrors frontend registry)
- Add accent_color/set_accent_color/effective_accent_color accessors in Settings
- Add set/get/get_effective Tauri commands + normalize_hex_accent_color validator
- Add providerAccentColors map to SettingsSnapshot bridge
- Add setProviderAccentColor/getProviderAccentColor/getProviderEffectiveAccentColor to tauri.ts
- Create AccentColorSection component (hex input, color picker, reset button)
- Inject --provider-accent CSS variable on MenuCard article and ChartsSection
- Update menu-metric__bar-fill and chart colors to use --provider-accent fallback
- Update chartPalette providerCostColor/providerCreditsColor fallback chain
- Pass providerAccentColors through TrayPanel/PopOutPanel/ProvidersTab/ProviderDetailPane

Also:
- Add 11 new locale keys to all 7 .ftl files + keys.ts
- Add costSummaryDisplayStyle + providerAccentColors to all test mock SettingsSnapshot
- Update chartPalette tests for --provider-accent fallback

* Resolve merge conflicts and fix gate checks

* Thermo-nuclear: extract ollama cookies, codex pricing, simplify accent color

* fix: correct serde attribute placement on currency_symbol after rebase
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. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. 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.

2 participants