Repository navigation
Restore Claude Code oauth, remember settings and fixes #2119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
79014dc
5e71bd0
118230e
812fe12
464891e
35f890e
ec41e7e
e70a5f8
92d5f13
f2dd4e8
5615fc7
e5c75aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,11 +21,26 @@ import { | |
| updateProviderProfile, | ||
| } from '../utils/providerProfiles.js'; | ||
| import { getSettings_DEPRECATED } from '../utils/settings/settings.js'; | ||
| import { ProviderManager } from './ProviderManager.js'; | ||
| import { | ||
| ProviderManager, | ||
| type ProviderManagerResult, | ||
| } from './ProviderManager.js'; | ||
| import { Select } from './CustomSelect/select.js'; | ||
| import { KeyboardShortcutHint } from './design-system/KeyboardShortcutHint.js'; | ||
| import { Spinner } from './Spinner.js'; | ||
| import TextInput from './TextInput.js'; | ||
|
|
||
| export function isSuccessfulProviderSetupResult( | ||
| result: ProviderManagerResult | undefined, | ||
| ): boolean { | ||
| return ( | ||
| !!result && | ||
| (result.action === 'saved' || result.action === 'activated') && | ||
| typeof result.message === 'string' && | ||
| result.message.length > 0 | ||
| ) | ||
| } | ||
|
Comment on lines
+33
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
rg -nP -A6 "platform_setup_complete" src/components/ConsoleOAuthFlow.tsx | head -60
rg -nP -B2 -A12 "type OAuthStatus" src/components/ConsoleOAuthFlow.tsxRepository: Gitlawb/openclaude Length of output: 2546 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- ProviderManagerResult definitions and usages ---'
rg -n -C 5 "ProviderManagerResult" src
printf '%s\n' '--- Helper and call-site context ---'
sed -n '1,90p' src/components/ConsoleOAuthFlow.tsx
sed -n '510,600p' src/components/ConsoleOAuthFlow.tsx
printf '%s\n' '--- TypeScript configuration and scripts ---'
rg -n -C 3 '"typecheck|typecheck:type-tests"' package.json
fd -a 'tsconfig*.json' . -x sh -c 'echo "--- $1"; sed -n "1,180p" "$1"' sh {}Repository: Gitlawb/openclaude Length of output: 12430 Return a type predicate from
🤖 Prompt for AI AgentsSource: Coding guidelines |
||
|
|
||
| export type ConsoleOAuthFlowResult = { | ||
| type: 'oauth'; | ||
| } | { | ||
|
|
@@ -559,7 +574,7 @@ function OAuthStatusMessage({ | |
| <ProviderManager | ||
| mode="first-run" | ||
| onDone={result => { | ||
| if (!result || result.action !== 'saved' || !result.message) { | ||
| if (!isSuccessfulProviderSetupResult(result)) { | ||
| setOAuthStatus({ state: 'idle' }) | ||
| return | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Cover the message branches of the predicate.
The tests exercise the action check but not the message check.
{ action: 'saved' }with a missing message and with an empty-string message both reach theplatform_setup_completestate in the old code and are exactly what the new helper rejects. Add both cases.💚 Proposed additions
Validate with
bun test ./src/components/ConsoleOAuthFlow.test.tsx. As per path instructions: block when "tests assert implementation details while missing the user-visible behavior"; here the message guard drives whether the success screen renders.📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Path instructions