Skip to content

[service] failed turn 永久阻塞会话:resume/cancel 被控制面 terminal 检查拒绝,会话死锁 #4011

Closed

Description

@linlihuiyang

环境信息

  • Version: agentscope-service 2.1.0-BETA1(官方 compose 包)
  • Deployment: Docker Compose, PostgreSQL 17
  • 已在 main 分支(81b109c95,2026-11-05)源码上确认仍未修复:findDispatchable 阻塞列表仍含 failed;service_invocation_command.go:107 terminal 检查仍在

Symptom

某 Turn 失败(模型 400、预算超限等)后,同一会话后续提交的所有 Turn 永远停在 queued,会话死锁,只能新建 Session。

Root cause(三层叠加)

  1. FIFO 准入:SessionTurnCommandRepository.findDispatchable 要求同会话不存在更早的 status IN ('queued','running','cancel_requested','requires_action','interrupted','failed') 的 turn
  2. 恢复通道被拒:数据面 SessionTurnInbox.resume() 支持恢复 failed turn,但控制面 createServiceCommand 在 serviceapi.Terminal(inv.Status) 时直接 409 "invocation has ended"——resume/cancel 都到不了数据面
  3. 错误提示误导:提示 "submit a new invocation",但新 turn 又被第 1 层的 failed 记录阻塞 → 死锁

Reproduce

  1. 创建 Managed Agent + Session
  2. 触发一次失败(如无效模型名,或预算超限)
  3. 同会话再提交 → 永远 queued;对失败 turn /resume、/cancel → 409

Suggestion

任选其一:

  • 控制面对 resume/cancel 命令豁免 terminal 检查;
  • 或 findDispatchable 把 failed 移出阻塞列表;
  • 或提供 acknowledge/discard 操作把 failed 转为非阻塞终态。

另外文档(session-event-log / turn 状态说明)声称 failed/interrupted turn 可 resume,与实际行为不符,建议同步修正。

Activity

  1. added a commit that references this issue on Nov 11, 2026
    53c0649
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions