Add debug logging and Accept headers for MCP transport debugging
- Added extensive debug logging to transport creation and connection flows - Added proper Accept header (application/json, text/event-stream) to transport options - Fixed scroll jittering during streaming with instant scroll behavior - Investigating HTTP transport 'Not connected' errors and SSE connection hanging
This commit is contained in:
parent
ccad616e02
commit
ba9e6c9f3f
1 changed files with 99 additions and 20 deletions
|
|
@ -22,7 +22,7 @@ const hasContent = (message: Message): message is UserMessage | AssistantMessage
|
|||
interface UseStreamResponseProps {
|
||||
conversationId?: number
|
||||
setConversations: React.Dispatch<React.SetStateAction<Conversation[]>>
|
||||
scrollToBottom: () => void
|
||||
scrollToBottom: (force?: boolean) => void
|
||||
selectedModel: Model
|
||||
onApiKeyRequired: (model: Model) => Promise<boolean>
|
||||
mcpTools: Tool[]
|
||||
|
|
@ -284,7 +284,7 @@ export const useStreamResponse = ({
|
|||
}
|
||||
return updated
|
||||
})
|
||||
scrollToBottom()
|
||||
scrollToBottom(true)
|
||||
} else {
|
||||
console.warn('[useStreamResponse] Tool call event missing toolName:', event)
|
||||
}
|
||||
|
|
@ -382,7 +382,7 @@ export const useStreamResponse = ({
|
|||
return updated
|
||||
})
|
||||
|
||||
scrollToBottom()
|
||||
scrollToBottom(true)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('[useStreamResponse] Error in full stream processing:', e)
|
||||
|
|
|
|||
Loading…
Reference in a new issue