Summary
After restarting the ACP/MCP services, the first ACP flow call that references an MCP tool fails consistently with a cancel-scope error. Retrying the exact same user action immediately after that first failure succeeds, and the system is stable after that.
Observed error
MCP tool call failed: Attempted to exit a cancel scope that isn't the current tasks's current cancel scope
In one recent shell run, this surfaced from the ACP workflow dialogue flow as:
{
"status": "error",
"error": "workflow_context_dialogue_prompt_failed",
"details": {
"status": "error",
"tool": "workflow_context_dialogue",
"warnings": [
"MCP tool call failed: Attempted to exit a cancel scope that isn't the current tasks's current cancel scope"
]
}
}
Reproduction pattern
- Restart ACP and MCP services.
- Trigger any ACP flow that touches an MCP tool or prompt bundle.
- The first such call fails with the cancel-scope error above.
- Retry the same action immediately.
- The retry succeeds, and subsequent calls are stable.
Current impact
- The failure is transient but user-visible.
- It affects the first
/ohdsi contextual guidance call after restart.
- It also likely affects any other first ACP flow invocation that needs MCP-backed prompt/tool access.
Notes
- This appears to be a service lifecycle / MCP client state issue rather than a workflow-specific prompt problem.
- The repeated pattern strongly suggests a warm-up / first-call bug in ACP<->MCP interaction.
- We are deferring this for now because the system is stable after the first retry, but it should be fixed because it degrades first-use reliability and complicates debugging.
Suggested investigation areas
- MCP client initialization / reconnect logic after ACP startup
- prompt bundle tool calls on the first request after service restart
- cancel-scope management around MCP tool invocation and cleanup
- whether a one-time warm-up call would mask or confirm the underlying issue
Summary
After restarting the ACP/MCP services, the first ACP flow call that references an MCP tool fails consistently with a cancel-scope error. Retrying the exact same user action immediately after that first failure succeeds, and the system is stable after that.
Observed error
MCP tool call failed: Attempted to exit a cancel scope that isn't the current tasks's current cancel scopeIn one recent shell run, this surfaced from the ACP workflow dialogue flow as:
{ "status": "error", "error": "workflow_context_dialogue_prompt_failed", "details": { "status": "error", "tool": "workflow_context_dialogue", "warnings": [ "MCP tool call failed: Attempted to exit a cancel scope that isn't the current tasks's current cancel scope" ] } }Reproduction pattern
Current impact
/ohdsicontextual guidance call after restart.Notes
Suggested investigation areas