Repository navigation
Conversation
…ic 'could not be saved' (Twigpine#1338) When the Codex OAuth flow completed and saveCodexCredentials() called into linuxSecretStorage, any failure from the secret-tool CLI was swallowed and returned as {success: false} with no warning. The user dialog then fell back to the generic 'Codex OAuth succeeded, but credentials could not be saved securely' message, leaving no actionable diagnostic. The Codex OAuth path explicitly opts out of the plaintext fallback (allowPlainTextFallback: false), so this swallowed error was the only signal the user ever saw on Ubuntu / GNOME setups where secret-tool was missing or gnome-keyring was not running (common over SSH without an active desktop session). linuxSecretStorage.update now: - Captures the secret-tool stderr from the execaSync result and surfaces it verbatim (prefixed with 'secret-tool:') when present, mirroring how windowsCredentialStorage already builds its warning via getFailureWarning. - Detects ENOENT (the secret-tool binary is missing) by both error.code and message, and returns an install hint pointing at libsecret-tools (apt) / libsecret (dnf). - Falls back to a Secret-Service-runtime hint plus the exit code when stderr is empty but the call still failed. The warning flows through saveCodexCredentials -> persistCredentials in useCodexOAuthFlow -> 'error' status, and is already rendered by both the ProviderManager and provider command 'Codex OAuth failed' dialogs as status.message. No dialog wiring change needed. Tests: 4 new cases in platformStorage.test.ts cover the stderr passthrough, ENOENT install-hint path, exit-code-only fallback, and the unchanged success path. Existing 'Linux secret-tool Interaction' suite continues to pass. Closes Twigpine#1338
Collaborator
|
#1347 already closed this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1338.
Summary
The Codex OAuth flow on Ubuntu / GNOME (and any Linux desktop without a working Secret Service) ends in the generic dialog:
That message is the catch-all fallback in `useCodexOAuthFlow` for when `saveCodexCredentials` returns `{success: false}` without a `warning`. Tracing it back: `saveCodexCredentials` opts out of plaintext fallback (`allowPlainTextFallback: false`), so on Linux it hits `linuxSecretStorage.update`, and that path swallowed every `secret-tool` failure mode into a bare `{success: false}` with no diagnostic. Two of the most common Linux failure modes:
The result is identical from the user side: OAuth succeeded, generic save-failure message, no path forward.
Fix
`src/utils/secureStorage/linuxSecretStorage.ts` `update()` now mirrors the existing pattern in `windowsCredentialStorage`:
The warning flows through:
No dialog wiring change needed; the existing render already uses `status.message`.
Test plan
Notes
Scope is intentionally limited to surfacing the existing-but-discarded failure reason on Linux. The behavior on success and on macOS / Windows is unchanged. macOS `security` CLI errors already surface through their own path, and Windows `update` already routes through `getFailureWarning`.