中止正在进行的工具或 LLM 调用,而不取消会话,以便代理继续运行。发送step_number以中断单个命名调用;省略正文可中断当前正在进行的每个调用。响应的结果准确报告了发生的情况:“aborted” (飞行中的物体被停止),“armed” (进行中没有任何操作;已为执行的下一次调用做好准备,pending=true), "already_armed" (未过期的臂已存在; TTL未延长),“noop_Terminal”是(执行已终止,可能在另一个副本上), "in_flight_elsewhere" (持久性步骤记录显示该调用正在进行中,但在此 OE副本上不显示;此处未中止任何操作,如果调度在此副本上完成,则作用域为盖章步骤的后退器会在调度时停止调用 — 它永远不会捕获稍后的调用) 或“noop” (命名的“step_number”在飞行中与任何内容都不匹配)。幂等:重复请求是安全的。
POST /api/v1/projects/{id}/executions/{execution_id}/interrupt
curl \
--request POST 'https://agentengine.mongodb.com/api/v1/projects/{id}/executions/{execution_id}/interrupt' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"step_number": 42
}'
请求示例
{
"step_number": 42
}
响应示例 (406)
操作不可用
{
"detail": "This operation is not available in API version 2026-09-20-preview.",
"error": 406,
"errorCode": "OPERATION_NOT_IN_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "This operation supports text/event-stream, which the Accept header excludes. Remove unsupported media-type parameters or accept this type with a positive q value.",
"error": 406,
"errorCode": "UNACCEPTABLE_MEDIA_TYPE",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "The requested API version is not supported. Supported versions: 2026-09-20-preview.",
"error": 406,
"errorCode": "UNSUPPORTED_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
响应示例 (406)
{
"detail": "This operation is not available in API version 2026-09-20-preview.",
"error": 406,
"errorCode": "OPERATION_NOT_IN_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
响应示例 (200)
{}
响应示例 (200)
{}
响应示例 (400)
{
"code": "string",
"error": "string",
"success": true
}
响应示例 (400)
{
"code": "string",
"error": "string",
"success": true
}
响应示例 (401)
{
"code": "string",
"error": "string",
"success": true
}
响应示例 (401)
{
"code": "string",
"error": "string",
"success": true
}
响应示例 (404)
{}
响应示例 (404)
{}
响应示例 (413)
{
"code": "string",
"error": "string",
"success": true
}
响应示例 (413)
{
"code": "string",
"error": "string",
"success": true
}
响应示例 (502)
{}
响应示例 (502)
{}