Skip to content

Commit 036f74b

Browse files
Dumbrisclaude
andcommitted
fix: clear OAuth error flags when transitioning to StateReady
When a server successfully authenticates via OAuth and transitions to StateReady, the StateManager was only clearing lastError and retryCount, but not the OAuth-specific flags (isOAuthError and oauthRetryCount). This incomplete cleanup could cause: - Stale error messages in the UI even after successful connection - Incorrect retry logic treating successful connections as still in error - Tool count issues if tool indexing depends on clean connection state This fix ensures all error-related state is reset when a connection becomes ready, providing a clean slate for the successful connection. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ef9cc34 commit 036f74b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/upstream/types/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ func (sm *StateManager) TransitionTo(newState ConnectionState) {
138138
if newState == StateReady {
139139
sm.lastError = nil
140140
sm.retryCount = 0
141+
sm.isOAuthError = false
142+
sm.oauthRetryCount = 0
141143
}
142144

143145
info := ConnectionInfo{

0 commit comments

Comments
 (0)