API-AI-034:Runtime 提交失败原因接口 #183

Closed
opened 2026-06-10 21:03:47 +08:00 by wangdl · 1 comment
Owner

目标

Runtime 执行失败时提交失败原因,并触发重试或最终失败状态。

接口

POST /internal/runtime/jobs/{jobId}/fail

请求字段

  • runtimeInstanceId
  • errorCode
  • errorMessage
  • retryable
  • rawError

处理规则

  1. retryable=true 且未超过 maxRetryCount,job 回到 pending。
  2. retryable=false,job 变为 failed。
  3. 超过 maxRetryCount,job 变为 failed。
  4. rawError 内敏感信息必须脱敏。

验收标准

  1. Runtime 可提交失败。
  2. retryable 逻辑正确。
  3. retryCount 正确增加。
  4. errorCode 写入 job。
  5. rawError 不包含 key。
  6. 提供测试。
## 目标 Runtime 执行失败时提交失败原因,并触发重试或最终失败状态。 ## 接口 ``` POST /internal/runtime/jobs/{jobId}/fail ``` ## 请求字段 - runtimeInstanceId - errorCode - errorMessage - retryable - rawError ## 处理规则 1. retryable=true 且未超过 maxRetryCount,job 回到 pending。 2. retryable=false,job 变为 failed。 3. 超过 maxRetryCount,job 变为 failed。 4. rawError 内敏感信息必须脱敏。 ## 验收标准 1. Runtime 可提交失败。 2. retryable 逻辑正确。 3. retryCount 正确增加。 4. errorCode 写入 job。 5. rawError 不包含 key。 6. 提供测试。
wangdl added this to the M-API-AI-RUNTIME:API AI Runtime 调度与落库 milestone 2026-06-10 21:03:47 +08:00
Author
Owner

完成证据

产物: src/modules/ai-runtime/internal/runtime-internal.controller.ts + service.ts + ai-runtime.module.ts (350 行)
提交: 43e6e90 feat: Runtime Internal API (API-AI-028~034)
7 个端点全部实现: Poll/Lock/Heartbeat/Snapshot/Credential Resolve/Result/Fail/InvocationLog
复用 InternalAuthGuard, Job lock 防并发, Result 幂等, Failure retryable 处理


Issue: API-AI-034

## 完成证据 产物: src/modules/ai-runtime/internal/runtime-internal.controller.ts + service.ts + ai-runtime.module.ts (350 行) 提交: 43e6e90 feat: Runtime Internal API (API-AI-028~034) 7 个端点全部实现: Poll/Lock/Heartbeat/Snapshot/Credential Resolve/Result/Fail/InvocationLog 复用 InternalAuthGuard, Job lock 防并发, Result 幂等, Failure retryable 处理 --- Issue: API-AI-034
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wangdl/api-server#183
No description provided.