fix(claude): add missing UI toggle for Claude Code credentials consent - #348
Conversation
76d3f01 gated Claude OAuth credential reading behind a new claude_allow_reading_claude_code_credentials setting (default off, upstream steipete#2634/steipete#2745) and pointed users at "Settings, Providers, Claude" to enable it, but never added that toggle anywhere in the frontend or CLI. The setting was unreachable: Auto silently fell back to reduced-fidelity CLI usage with no way to opt back into OAuth. - Wire the field through the Tauri bridge (SettingsSnapshot and SettingsUpdate in commands/bridge.rs and commands/settings.rs) the same way claude_daily_routines_usage_visible already is. - Add claudeAllowReadingClaudeCodeCredentials to the TS bridge types. - Add an "Allow reading Claude Code's credentials" checkbox to ClaudeCreds.tsx, next to the existing Avoid Keychain Prompts and Show Daily Routines toggles. - Add ProviderClaudeAllowReadingClaudeCodeCredentials(Help) locale keys, with English (source of truth) and Turkish translations. - Tests: Rust settings default plus apply_advanced_settings coverage, and a new ClaudeCreds.test.tsx covering render and toggle round-trip. Verified locally: - node apps/desktop-tauri/scripts/check-locale-drift.mjs: OK, 807 keys match - cargo test --manifest-path rust/Cargo.toml settings: 94 passed - cargo test --manifest-path rust/Cargo.toml locale: 16 passed - cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml -- settings locale: 38 passed - cargo fmt --all -- --check: clean - cargo clippy --all-targets -- -D warnings (both crates): clean - pnpm --dir apps/desktop-tauri test: 268 passed (44 files) - pnpm --dir apps/desktop-tauri run build (tsc --noEmit + vite build): clean
|
Heads up on the "Local check" failure — it's pre-existing on The only failing test is I reproduced it on plain So this looks like an existing bug/flake on |
|
Thermo-nuclear review verdict: PASS WITH ONE SMALL QUALITY FIX.\n\nProduction implementation is structurally sound:\n- the consent flag stays in the canonical Settings -> Tauri bridge -> provider UI path\n- no new cross-provider branching or parallel settings system\n- no >1k-line growth or feature-container regression\n- no unnecessary abstraction: the Claude-specific toggle logic is local and boring\n- the change directly fixes issue #347 without altering the default-off consent boundary\n\nOne quality issue found in the new test:\n- ClaudeCreds.test.tsx fabricates a partial SettingsSnapshot and casts it to the full type, then uses another DOM cast to find the checkbox. That hides boundary/type mistakes and is exactly the kind of cast-heavy test shortcut the thermo-nuclear skill rejects.\n\nI fixed this locally by:\n- replacing the fake full snapshot cast with Pick<SettingsSnapshot, ...> for the exact Claude settings used by the component\n- querying the checkbox by accessible role/name instead of crawling the label DOM and casting to HTMLInputElement\n\nIndependent validation completed so far:\n- focused ClaudeCreds tests: 2/2 PASS\n- TypeScript tsc --noEmit: PASS\n- Vite production build: PASS\n- CUA driver is installed and available for the required Windows Settings UI proof\n\nRemaining before final merge approval:\n- finish a fresh Tauri debug build + CUA proof of the checkbox off-by-default and persistence after enabling\n- complete independent Rust/Tauri test reruns once the intermittent CodexPro 502s stop interrupting long commands\n\nNo additional production-code blocker found in the PR diff. |
|
Final acceptance after thermo-nuclear review:\n\n- thermo cleanup is included in the PR head (typed Pick-based Claude settings fixture + accessibility-role checkbox queries, no cast-heavy test shortcut)\n- PR branch updated onto repaired main after #349\n- hosted Local check: PASS at head 9e0fa08\n- fresh Vite production build: PASS\n- fresh Tauri debug binary produced from this head\n- Windows CUA proof on Settings -> Providers -> Claude:\n - new 'Allow reading Claude Code's credentials' checkbox is present\n - OFF state reproduced the consent-gate behavior\n - enabling the checkbox changed the provider path from 'credential reading is off' to the consented credential lookup ('Claude sign-in was not found' on this machine)\n - freshly rebuilt CLI used the app's own Settings::load/config-dump path and reported claude_allow_reading_claude_code_credentials=true, proving protected-settings persistence\n - checkbox was restored to OFF through CUA; config dump then reported false, leaving the user's configuration unchanged\n\nProof artifacts retained locally:\n- proof-pr348-claude-off.png\n- proof-pr348-claude-on.png\n- proof-pr348-claude-on-visible.png\n\nThermo verdict: PASS. Merge-ready. |
Summary
Fixes a bug where the Claude Code OAuth credentials consent gate added in 76d3f01 is unreachable through the app.
76d3f01 introduced
claude_allow_reading_claude_code_credentials(defaultfalse) and made the OAuth credential loader return this error when it's off:However, that setting was only ever wired into the Rust backend (
rust/src/settings.rs,rust/src/providers/claude/...). No UI checkbox and no CLI flag exist anywhere to actually turn it on — I confirmed this by grepping the entire frontend andcodexbar-clisource for the field name (zero hits outside the backend). So every user hits this error message telling them to go flip a setting that doesn't exist anywhere to flip, and Claude silently stays on reduced-fidelity CLI usage forever.Fix
claude_allow_reading_claude_code_credentialsthrough the Tauri bridge (SettingsSnapshot/SettingsUpdateincommands/bridge.rsandcommands/settings.rs), the same way the neighboringclaude_daily_routines_usage_visiblesetting already is.claudeAllowReadingClaudeCodeCredentialsto the TS bridge types (bridge.ts).ClaudeCreds.tsx, right next to the existing "Avoid Keychain Prompts" and "Show Daily Routines usage" toggles in Settings → Providers → Claude.ProviderClaudeAllowReadingClaudeCodeCredentials/...Helplocale keys — English (source of truth) plus a Turkish translation.settings::tests::test_settings_defaultnow asserts the off-by-default value; a newapply_advanced_settings_sets_claude_code_credentials_consenttest incommands/settings.rs; a newClaudeCreds.test.tsxcovering render + toggle round-trip throughupdateSettings.No behavior change to the consent gate itself (still off by default, still requires explicit opt-in) — this only adds the missing way to actually opt in.
Testing
Ran from repo root (MSVC toolchain; the default GNU toolchain in my environment is missing
dlltool.exe):Results:
check-locale-drift: OK, 807 keys match between Rust and TSrust\Cargo.tomlsettings tests: 94 passedrust\Cargo.tomllocale tests: 16 passedcargo fmt --check: cleancargo clippy -D warnings: clean on both cratespnpm test: 268 passed across 44 files (includes newClaudeCreds.test.tsx)pnpm run build(tsc --noEmit+vite build): cleanNo visual redesign — just one more checkbox in an existing section, styled identically to its neighbors — so no CUA Driver capture; happy to add a screenshot if maintainers want one.