Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ export default function Home() {
}
}, [hasApiKey, apiKeyStatus, justDidReset])

// Ensure model load status is set correctly when model is selected
useEffect(() => {
if (hasModel && modelLoadStatus !== 'success') {
setModelLoadStatus('success')
}
}, [hasModel, modelLoadStatus])
Copy link

Choose a reason for hiding this comment

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

Bug: Effect Hook Forcing False Positives on Loading Status

The new useEffect unconditionally sets modelLoadStatus to 'success' whenever hasModel is true, which overrides 'loading' and 'error' states emitted by ModelSelector (via onLoadingChange and onError). This can mask failures and prematurely clear loading indicators, showing a green checkmark even when model loading fails or is in progress.

Fix in Cursor Fix in Web


const handleApiKeyValidated = (isValid: boolean, key?: string) => {
if (isValid && key) {
setApiKeyStatus('success')
Expand Down