fix(mcp): trigger OAuth prompt during tool registration and dedupe helpers
OAuth authorization was only handled in MCPTool.Execute, so unauthenticated services failed silently during RegisterMCPTools before any tool reached the agent. Wire EventBus/session metadata into registration and reuse the same getOrCreateMCPClientWithOAuthRetry path used at execution time. Extract MCP OAuth session/wait/connect logic into mcp_oauth.go and remove the duplicate waitForOAuthAndRetry + RegisterMCPContext layering in mcp_tool.go.
This commit is contained in:
@@ -41,7 +41,7 @@ type AgentService interface {
|
||||
chatModel chat.Chat,
|
||||
rerankModel rerank.Reranker,
|
||||
eventBus *event.EventBus,
|
||||
sessionID string,
|
||||
sessionID, assistantMessageID string,
|
||||
) (AgentEngine, error)
|
||||
|
||||
// ValidateConfig validates an agent configuration
|
||||
|
||||
Reference in New Issue
Block a user