Skip to content

subagents: 精简完成态主会话展示并隐藏 transport instruction #174

Closed

Description

@tt-a1i

问题

Direct Subagent 完成后,主会话直接铺开完整 child final answer,并把 transport 给父模型的内部指令也显示给用户:

(This result is already shown to the user. Act on it and relay only the
 decisions or next steps — do not repeat it verbatim.)

当前完成态的问题:

  • 大段 child 输出常驻主 transcript,显著压过父 Agent 的最终汇报;
  • header、child 原始报告、父 Agent 后续总结形成重复表达;
  • 用户可见 UI 泄漏了只用于约束父模型的 transport instruction;
  • 多个 subagent 同时完成时,主会话可被数屏原始报告占满;
  • completion 的执行事实、模型上下文和 operator UI 没有形成独立投影。

期望

改进 Direct Subagent 完成后返回主会话的展示,不改变可靠交付、消费水位和模型可见结果:

  • collapsed 状态显示单行紧凑摘要:subagent 名称、状态、耗时,以及是否存在失败/重要结果;
  • child 完整 final answer 默认折叠,expand 后可查看;
  • transport instruction 只进入模型可见 payload,永远不进入用户可见 renderer;
  • 父 Agent 的主汇报仍由模型完成,UI 不重复伪造结论;
  • error、uncertain、worktree/handoff、artifact failure 等异常在 collapsed 状态可见;
  • 批量完成有有界、稳定、不刷屏的聚合展示;
  • exact result artifact、delivery identity、at-least-once retry 和 consumed watermark 语义保持不变。

验收标准

  1. collapsed UI 不显示完整 child answer 和内部 transport instruction;
  2. expand 后可以读取完整 child answer,但仍不显示内部 instruction;
  3. 单个成功、失败/uncertain、多个 completion 分别有 renderer 测试;
  4. 用户可见投影与父模型可见 payload 分开测试;
  5. 长文本、窄终端、terminal control 字符均保持有界和安全;
  6. 父 Agent 仍能获得完整的可恢复结果并完成主汇报;
  7. bun run check && bun run test 通过。

截图现象

当前完成卡片在 ✓ subagent sa-2 · ... · finished 下直接展示数十行审查结果,末尾还显示上述 “This result is already shown...” 内部指令。

Activity

  1. added
    enhancement
    on Aug 25, 2026
  2. 627150795 commented on Aug 28, 2026

    @627150795
    Contributor

    Hi! I am taking this issue. I will implement the completion-state presentation seam: keep the full result in the parent model payload, separate the user-visible projection so the transport instruction never renders, and add bounded collapsed/expanded renderer coverage for success, failure/uncertain, and batched results. I will preserve result artifacts, delivery identity, at-least-once retry, and consumed-watermark semantics. The repository does not allow contributors to self-assign this issue, so this comment is the claim record.

  3. 627150795 commented on Aug 28, 2026

    @627150795
    Contributor

    Implementation is ready in PR #240: #240. It separates the model-facing result payload from the user-visible completion card, defaults the card to a bounded compact summary, hides the transport instruction, includes elapsed time for automatic and explicit waits, and preserves delivery/artifact/watermark semantics. Focused tests, lint, typecheck, and diff checks pass; the remaining full-suite/check limitations are documented in the PR.

  4. 627150795 commented on Aug 28, 2026

    @627150795
    Contributor

    Update: PR #240 is now based on the latest upstream main. The result-display projection change remains scoped to subagent transport/UI separation; 23 focused tests, lint, typecheck, and diff checks pass.

  5. 627150795 commented on Aug 29, 2026

    @627150795
    Contributor

    代码审计更新(对应 PR #240):

    • transport instruction 现在只清理真正位于结果末尾的传输后缀,不会误删子代理原回答中的同文内容。
    • artifact 写入失败已进入结构化结果,并在单个/批量折叠视图中明确显示。
    • subagent 针对性测试 15/15,lint/typecheck 通过。

    这些是对原 PR 行为有效性的补充修复,未改变结果投递与展开查看路径。

  6. 627150795 commented on Aug 29, 2026

    @627150795
    Contributor

    代码有效性复核更新(不是格式检查):

    • PR fix(subagents): separate result display projection #240 当前仍为 OPEN,提交头为 deda251,未被关闭或撤回。
    • Subagent 相关 focused tests:27/27 通过。
    • bun run typecheck:通过。
    • bun run lint:通过。
    • git diff --check:通过。
    • 本轮没有发现结果投递、折叠展示、artifact 失败提示或传输文本清理的回归。

    当前 GitHub 显示 Review required / BLOCKED 是等待维护者审批和 CI 工作流授权,不是代码测试失败。认领记录仍保留在本 Issue 的第一条留言。

  7. 627150795 commented on Aug 29, 2026

    @627150795
    Contributor

    进一步代码审计后发现并修复了一处真实接线缺口:

    原来的自动完成投递路径仍使用只返回字符串的旧包装函数,artifact 保存失败时不会把失败标记传给结果详情。现在自动投递改为使用带结构化状态的投影函数,并新增了“真实 artifact 目录不可写”的回归测试。

    验证结果:

  8. 627150795 commented on Aug 29, 2026

    @627150795
    Contributor

    代码有效性审计结论:PR #240 的核心目标在当前远程提交 f2796e7 上有效:模型收到完整 transport payload,用户界面收到有界 display projection,legacy transport suffix 会被清理,compact/full 设置和 artifact-save failure metadata 均走真实 renderer/delivery 路径。正式 Node 定向测试 28/28、lint、typecheck 通过;未发现需要追加的核心运行时修复。Session 重载、watermark/retry 的完整端到端覆盖仍属于测试增强项,不是本次审计发现的行为失败。

  9. tt-a1i commented on Sep 7, 2026

    @tt-a1i
    CollaboratorAuthor

    已核对 #240 已合并到 main:默认紧凑完成展示、可展开详情、模型 payload 与用户投影分离、隐藏 transport-only instruction,并保留交付语义及 artifact 保存失败反馈。按已完成关闭。

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions