Skip to content

[bug] BTW 用户中止的工作任务被标记为已完成 #153

Description

@BegoniaHe

Preflight

  • I searched open and closed Issues and PRs.
  • I tested the current master branch or the exact commit.
  • This report contains no secrets, tokens, or private data.
  • This is not a security vulnerability (those use a private advisory).
  • I filled exactly one of Human note or Agent note, matching who wrote this Issue.

Affected area

Providers / agent runners

What happened

P2 / medium · AUD-20260910-agent-002

run_agent 收到 aborted 后设置 agent_user_aborted=True 并清除 agent_stop_requested;WorkLoop 只检查后一个标志,因此用户中止被记录为 completed。使用真实 run_agent 与 WorkLoop 的组合实验已确认。

Minimal reproduction

启用 BTW 和 work loop,启动本地 Agent 的 /work 任务,执行中发送 /task stop,等待执行器正常发出 aborted,再运行 /work status。确定性离线复现:将 tests/unit/test_astr_agent_run_util.py 的 FakeRunner 配成只产生 aborted,用真实 run_agent 包装为 WorkLoop.executor。

Expected: 任务状态为 cancelled。

Actual: agent_user_aborted=true;agent_stop_requested=false;WorkSession.status=completed。

Impact: /work status 将实际中止的任务报告为已完成。

Code evidence

Suggested acceptance criteria

  • 依据执行器的终态或 agent_user_aborted 记录 cancelled,并覆盖真实 run_agent 的组合测试。
  • 在当前真实控制流上增加失败路径组合回归,不能只断言测试替身抛异常或手工设置工作状态。
  • 保持 BTW 默认关闭、现有授权和原请求身份;如调整用户行为,同步中英文文档。

Validation and limits

真实 run_agent + WorkLoop 组合,只有模型 runner 使用测试替身。

本次审计运行:首轮 BTW/入口/状态/能力路由相关测试 173 passed;Agent、工具、历史、配置与导入边界测试 327 passed;pipeline/WebChat/生命周期测试 108 passed;两套循环选择器测试 3 passed。另运行上述确定性组合探针,并完成独立只读反证。现有测试通过不代表已覆盖此缺陷。未改动产品代码。

已检索全部 61 条 Issue 与 89 条 PR(含关闭/合并状态,审计开始时快照),未发现本缺陷的重复报告。关联已完成的功能跟踪 #125#126#127,以及总跟踪 #122;自动分类器实验 #133#135 不属于此缺陷。

Commit or version

037994ea4c8c289e4d5c8e7611a835ced93eeddd (master)

Environment

Linux,源码 checkout;Python 3.14.6;Node.js v26.8.1。后端探针使用内存/临时目录,不访问开发者数据或真实 IM、付费模型。

Author

Agent

Agent note

Codex 按用户授权结合代码审查与仓库 audit-product 技能报告此问题,并使用独立只读 AI agent 反证。目标是修复 BTW 工作循环的实际行为;涉及路径见上方证据,已运行检查与剩余限制如上。本 Issue 按 bug_report.yml 填写;本次只审计、建单,没有修改产品代码或声称修复已完成。

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions