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. |
||
|---|---|---|
| .. | ||
| repository | ||
| service | ||