中止某个执行的正在进行的工具或 LLM 调用,而不取消会话,以便代理继续。发送 step_number 以中断单个指定调用;省略主体以中断当前所有正在进行的调用。响应的结果报告准确地指出发生了什么:"aborted" (某个正在运行的事务已经停止)、"armed" (没有正在运行的事务;已为执行的下一个调用做好准备,pending=true)、"already_armed" (已存在未过期的准备;TTL 未延长)、"noop_terminal" (执行已经终端,可能在另一个副本上)、"in_flight_elsewhere" (持久性步骤记录显示调用正在运行,但不在此 OE 副本上;此处未中止任何内容,如果分派在此副本上完成,则限定于已盖章步骤的后备将在分派时停止调用 — 它永远不能捕获后续调用)、或 "noop" (命名的 step_number 与正在运行的任何内容都不匹配)。幂等: 重复请求是安全的。
POST /API/v1/项目/{ID}/执行/{execution_ID}/中断
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)
{}