File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -1537,14 +1537,20 @@ export class Agent<
15371537 const result = await this . mcp . handleCallbackRequest ( request ) ;
15381538
15391539 // If auth was successful, establish the connection in the background
1540- // establishConnection() will fire onServerStateChanged event which triggers another broadcast
15411540 if ( result . authSuccess ) {
1542- this . mcp . establishConnection ( result . serverId ) . catch ( ( error ) => {
1543- console . error (
1544- "[Agent handleMcpOAuthCallback] Background connection failed:" ,
1545- error
1546- ) ;
1547- } ) ;
1541+ this . broadcastMcpServers ( ) ;
1542+
1543+ this . mcp
1544+ . establishConnection ( result . serverId )
1545+ . catch ( ( error ) => {
1546+ console . error (
1547+ "[Agent handleMcpOAuthCallback] Connection establishment failed:" ,
1548+ error
1549+ ) ;
1550+ } )
1551+ . finally ( ( ) => {
1552+ this . broadcastMcpServers ( ) ;
1553+ } ) ;
15481554 }
15491555
15501556 // Return the HTTP response for the OAuth callback
You can’t perform that action at this time.
0 commit comments