Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 18, 2026

Related GitHub Issue

Closes: #10819

Roo Code Task Context (Optional)

This PR was created by Roomote to address issue #10819. Feedback and guidance are welcome.

Description

When using OAuth-based providers (openai-codex or claude-code) in the welcome screen, users would:

  1. Select "OpenAI - ChatGPT Plus/Pro" (which sets apiProvider to "custom")
  2. Sign in via OAuth (the button redirects and completes authentication)
  3. Click "Finish" - but nothing happens, the welcome screen does not dismiss

Root cause: After OAuth completes, postStateToWebview() in the backend overwrites the local webview apiConfiguration with the backend state. However, at this point the backend state does not have apiProvider: "openai-codex" set yet because the user had not clicked Finish to save it. This causes checkExistKey() to return false, keeping showWelcome = true.

Solution: Add useEffect hooks in WelcomeViewProvider.tsx that detect when OAuth completes for these providers and automatically save the configuration. This follows the existing pattern already used for Roo provider authentication (lines 53-76 in the same file).

Key implementation details:

  • Check for selectedProvider === "custom" AND apiConfiguration?.apiProvider === "openai-codex" AND openAiCodexIsAuthenticated
  • When all conditions are true, automatically send the upsertApiConfiguration message to save the config
  • Same pattern applied for claude-code provider with claudeCodeIsAuthenticated
  • This triggers the save flow which then causes checkExistKey() to return true and dismiss the welcome screen

Test Procedure

  1. Start with a fresh Roo Code installation (or clear your API configuration)
  2. On the welcome screen, select "OpenAI - ChatGPT Plus/Pro" provider
  3. Click the "Sign In" button to authenticate via OAuth
  4. After OAuth completes, observe that the welcome screen automatically dismisses
  5. Verify the provider configuration is saved correctly

Previously, step 4 would fail - the welcome screen would remain visible even after OAuth succeeded.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A - This is a logic fix that affects the OAuth flow, not a visual change.

Documentation Updates

  • No documentation updates are required.

Additional Notes

This fix also applies to the claude-code provider which uses the same OAuth pattern. The implementation mirrors the existing Roo provider authentication handling in the same file.

Get in Touch

@roomote


Important

Adds useEffect hooks in WelcomeViewProvider.tsx to auto-save configuration when OAuth completes for openai-codex and claude-code, dismissing the welcome screen.

  • Behavior:
    • Adds useEffect hooks in WelcomeViewProvider.tsx to auto-save config when OAuth completes for openai-codex and claude-code providers.
    • Checks selectedProvider === "custom", apiConfiguration?.apiProvider, and authentication status to trigger config save.
    • Sends upsertApiConfiguration message to save config, dismissing welcome screen.
  • Conditions:
    • Handles openai-codex with openAiCodexIsAuthenticated.
    • Handles claude-code with claudeCodeIsAuthenticated.

This description was created by Ellipsis for 6fbe59e. You can customize this summary. It will automatically update as commits are pushed.

…de providers

When using OAuth-based providers (openai-codex or claude-code) in the welcome screen,
the user would select the provider, sign in via OAuth, but then clicking "Finish"
would not dismiss the welcome screen.

Root cause: After OAuth completes, postStateToWebview() overwrites the local
apiConfiguration with the backend state, which does not have the apiProvider
set yet (since the user had not clicked Finish to save it).

Solution: Add useEffect hooks that detect when OAuth completes for these providers
and automatically save the configuration, following the existing pattern for the
Roo provider authentication flow.

Fixes #10819
@roomote
Copy link
Contributor Author

roomote bot commented Jan 18, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. No bugs or issues found.

The PR correctly adds useEffect hooks to detect OAuth completion for openai-codex and claude-code providers and auto-save the configuration, following a similar pattern to the existing Roo provider authentication flow.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] OpenAI - ChatGPT Plus/Pro setup not working

2 participants