fix: API key keychain security + voice command injection + dead code cleanup #4734
Cross-repo impact
See what breaks downstream if this PR merges.
⮌ Merged
This pull request was merged into main.
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts
Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/voxlen/pull/67
Summary
Three independent improvements since the last merge:
1. API key keychain security hardening (
src/lib/keyring.ts,src/stores/settings.ts)setSecret()was falling back tolocalStorageunconditionally — if the OS keychain failed inside the real Tauri app (locked wallet, missing libsecret on Linux), API keys silently landed in plaintext storageisTauri()gate — localStorage fallback only applies in browser/dev mode where the Tauri IPC bridge is absentschedulePersistcatches them and shows a user-visible toast2. Voice command + clause injection (
src/hooks/useTauriEvents.ts)inject_text3. Dead code removal (
src/stores/settings.ts,src/hooks/usePersistedSettings.ts)isLoadedwas declared inSettingsStatebut never set totrueor read anywheresaveSettings()was the old plain-JSON API-key saver, already removed from App.tsx — orphaned export cleaned upTest plan
npm test -- --run)npx tsc --noEmit).into the focused app_kr_*keys appear in browser localStorage in production🤖 Generated with Claude Code
https://claude.ai/code/session_01Ggw2m7nwT2HDNaQJqSX6Sp
Generated by Claude Code