@@ -93,6 +93,7 @@ var agentPromptMap = map[string]prompt.PromptID{
95func NewAgent(
95func NewAgent(
96 agentCfg config.Agent,
97 agentCfg config.Agent,
97 // These services are needed in the tools
98 // These services are needed in the tools
98 permissions permission.Service,
99 permissions permission.Service,
@@ -110,7 +111,7 @@ func NewAgent(
110 if taskAgentCfg.ID == "" {
111 if taskAgentCfg.ID == "" {
111 return nil, fmt.Errorf("task agent not found in config")
112 return nil, fmt.Errorf("task agent not found in config")
113− taskAgent, err := NewAgent(taskAgentCfg, permissions, sessions, messages, history, lspClients)
114+ taskAgent, err := NewAgent(ctx, taskAgentCfg, permissions, sessions, messages, history, lspClients)
114 if err != nil {
115 if err != nil {
115 return nil, fmt.Errorf("failed to create task agent: %w", err)
116 return nil, fmt.Errorf("failed to create task agent: %w", err)
@@ -197,7 +198,7 @@ func NewAgent(
199 mcpToolsOnce.Do(func() {
200 mcpToolsOnce.Do(func() {
200− mcpTools = doGetMCPTools(permissions, cfg)
201+ mcpTools = doGetMCPTools(ctx, permissions, cfg)
202 allTools = append(allTools, mcpTools...)
203 allTools = append(allTools, mcpTools...)