Skip to content

fix(tui): clarify /logout credential scope#2714

Closed
xyuai wants to merge 1 commit into
Hmbown:mainfrom
xyuai:fix-2660-logout-scope
Closed

fix(tui): clarify /logout credential scope#2714
xyuai wants to merge 1 commit into
Hmbown:mainfrom
xyuai:fix-2660-logout-scope

Conversation

@xyuai

@xyuai xyuai commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • clarify the /logout command description so it no longer reads like a single-provider logout flow
  • make the success message explicit that /logout clears saved config API keys and is not provider-scoped
  • point users to codewhale auth clear --provider <id> and codewhale auth set --provider <id> for one-provider key replacement
  • add a regression test for the new guidance

Fixes #2660.

Greptile Summary

This PR clarifies that /logout clears all saved config API keys rather than a single provider's key, and guides users to codewhale auth clear/set --provider <id> for per-provider replacement. The change updates the command description in 6 locales and tightens the test to assert on the new message content.

  • config.rs: Doc comment, success message, and test updated to use "saved config API keys" wording and include the provider-scoped CLI guidance.
  • localization.rs: CmdLogoutDescription updated consistently across all supported locales (English, Vietnamese, Japanese, Chinese Simplified, Portuguese Brazil, Spanish Latin America).
  • The error path ("Failed to clear API key: {e}") retains the old singular phrasing, which is now inconsistent with the success path.

Confidence Score: 4/5

Safe to merge; changes are limited to user-facing strings and a test assertion — no logic is altered.

The success message, doc comment, localization strings, and test are all updated correctly. The only rough edge is that the error-path message still says "API key" (singular) while everything else now says "API keys" (plural), leaving a small inconsistency visible to users on failure.

No files require special attention; the minor wording inconsistency is in the Err branch of logout in config.rs.

Important Files Changed

Filename Overview
crates/tui/src/commands/config.rs Updated logout doc comment and success message to clarify that /logout clears all saved config API keys (not a single provider); regression test updated to assert on the new message strings. The error-path message ("Failed to clear API key") was not updated and is now inconsistent with the success path.
crates/tui/src/localization.rs Updated CmdLogoutDescription in all 6 supported locales (English, Vietnamese, Japanese, Chinese Simplified, Portuguese Brazil, Spanish Latin America) to reflect the new "saved config API keys" wording. Updates appear accurate and consistent.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User runs /logout] --> B[clear_api_key called]
    B --> C{Result}
    C -- Ok --> D["Success message:\n'Cleared saved config API keys\nand returned to setup.\n/logout is not provider-scoped.\nUse codewhale auth clear/set\n--provider id for one provider.'"]
    D --> E[app.onboarding = ApiKey\nonboarding_needs_api_key = true\napi_key_input cleared]
    C -- Err --> F["Error: 'Failed to clear API key: e'\n(singular — inconsistent with success path)"]
Loading

Fix All in Codex Fix All in Claude Code Fix All in Cursor

Reviews (1): Last reviewed commit: "fix(tui): clarify /logout credential sco..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Thanks @xyuai for taking the time to contribute.

This repository is currently observing a maintainer-managed contribution gate in dry-run mode, so this pull request is staying open. When enforcement is enabled, pull requests from contributors who are not listed in .github/APPROVED_CONTRIBUTORS will be closed automatically.

Please read CONTRIBUTING.md for the expected contribution shape. A maintainer can grant PR access by commenting /lgtm on a pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the /logout command's success message and localized descriptions across multiple languages to clarify that it clears all saved config API keys rather than a single provider-scoped key, providing CLI commands to clear/set individual provider keys instead. The feedback suggests adding explicit newlines to the logout message to prevent awkward line wrapping in standard terminal widths.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +1375 to +1380
CommandResult::message(
"Cleared saved config API keys and returned to setup.\n\
`/logout` is not provider-scoped. To replace one provider key, run \
`codewhale auth clear --provider <id>` then \
`codewhale auth set --provider <id>`.",
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The current multiline string concatenation results in a single continuous line of 141 characters for the second line of the message. In standard terminal windows (often 80 or 120 columns wide), this long line will wrap awkwardly, potentially splitting the commands across lines and making them difficult to read or copy-paste.

Consider adding explicit newlines (\n) to place the commands on their own lines for better readability and usability.

            CommandResult::message(
                "Cleared saved config API keys and returned to setup.\n\
                 `/logout` is not provider-scoped. To replace one provider key, run:\n\
                 `codewhale auth clear --provider <id>`\n\
                 `codewhale auth set --provider <id>`",
            )

`codewhale auth set --provider <id>`.",
)
}
Err(e) => CommandResult::error(format!("Failed to clear API key: {e}")),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 The error message still uses singular "API key" while the success message and all updated descriptions now use plural "API keys". These should be consistent so users get the same framing regardless of whether the operation succeeds or fails.

Suggested change
Err(e) => CommandResult::error(format!("Failed to clear API key: {e}")),
Err(e) => CommandResult::error(format!("Failed to clear saved config API keys: {e}")),

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Codex Fix in Claude Code Fix in Cursor

@Hmbown

Hmbown commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Ported to codex/v0.8.53 in 5719301. /logout message now names the active provider.

@Hmbown Hmbown closed this Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auth: /logout is ambiguous in multi-provider credential flows

2 participants