Skip to content

[Bug] Runtime event wording causes premature success claims in subagent flows #44471

Closed

Description

@Mdx2025

Problem

The runtime currently emits an internal completion event with wording "ready for user delivery" which agents interpret as a signal that the task is complete and ready to be reported to the user.

However, in subagent workflows, this creates a critical bug where:

  • "subagent completed successfully" is treated as equivalent to "external objective completed"
  • Agents respond "done/ready/complete" without verifying if external resources (GitHub, deployments, etc.) were actually modified
  • Textual results from subagents are treated as confirmation rather than input material

Affected Files

The following runtime bundles contain the misleading event wording:

  1. compact-1mmJ_KWL.js - Line containing "ready for user delivery"
  2. pi-embedded-D6PpOsxP.js - Similar internal event wording
  3. reply-BCcP6j4h.js - Similar internal event wording

Proposed Fix

Change the event wording from:

  • "ready for user delivery"

To:

  • "available for review"

And add explicit instruction:

  • "Verify whether the result is only text/analysis or if the external target was actually applied and verified. Do not say done/ready/complete without evidence of final state."

Impact

This mitigates the "premature success / missing final verification" pattern where agents incorrectly claim completion after subagent returns, without validating:

  • Whether the subagent's scope included actual external changes
  • Whether GitHub issues/PRs were actually modified
  • Whether deployments were actually triggered

Related

  • Session: 2026-03-12 mitigation applied locally
  • Workspaces affected: reasoning, coder, writer
  • Pattern: subagent completion != external objective verification

Activity

  1. openclaw-barnacle commented on Apr 28, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  2. added
    stale
    on Apr 28, 2026
  3. clawsweeper commented on Apr 28, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.

    Summary
    Keep open: current main has replaced the exact subagent ready for user delivery instruction with review/verification wording, but the issue is still paired with open closing PR #78985 and current main still carries remaining finality wording in related status/docs/task surfaces.

    Reproducibility: yes. Source inspection on current main shows the exact old ready for user delivery phrase is fixed, but remaining finality wording is still reproducible in completed successfully status/docs text and Background task done task terminal output.

    Next step
    An open PR with closing syntax already targets this issue, so a new ClawSweeper repair job would duplicate active work.

    Review details

    Best possible solution:

    Review and either land or supersede #78985 after reconciling it with #82724, keeping review-first wording where a parent review actually occurs and direct-safe wording elsewhere.

    Do we have a high-confidence way to reproduce the issue?

    Yes. Source inspection on current main shows the exact old ready for user delivery phrase is fixed, but remaining finality wording is still reproducible in completed successfully status/docs text and Background task done task terminal output.

    Is this the best way to solve the issue?

    Yes, a source-level wording fix is the right direction; editing compiled bundles would be temporary. The active fix path should be reviewed against current main so the final wording does not promise parent review on direct-delivery paths.

    What I checked:

    Likely related people:

    • 100menotu001: Authored the merged review-first subagent handoff change and also owns the open closing PR that targets the remaining agents/tasks/docs wording cleanup. (role: recent source-level fix contributor; confidence: high; commits: 8040f28bc5e7, f4f828fadb08; files: src/agents/subagent-announce.ts, src/agents/subagent-announce.format.e2e.test.ts, docs/tools/subagents.md)
    • vincentkoc: GitHub file history ties Vincent Koc to the task delivery policy extraction and fallback subagent completion delivery paths adjacent to the remaining Background task done surface. (role: task delivery policy contributor; confidence: high; commits: 817ac551b655, a1b656705992; files: src/tasks/task-executor-policy.ts, src/tasks/task-registry.ts, src/agents/subagent-announce.ts)
    • steipete: Recent file history shows in-process subagent announce handoff, subagent orchestration, and task policy/routing work in the same area; local blame also points to Peter Steinberger on the current task terminal formatter lines. (role: recent adjacent task and subagent contributor; confidence: medium; commits: 3cef9a65d354, 59fb9e5ca7fe, 1a956b6ba1; files: src/agents/subagent-announce.ts, docs/tools/subagents.md, src/tasks/task-executor-policy.ts)
    • ringlochid: GitHub file history shows work on task status and user-facing internal-context leak paths in src/tasks/task-executor-policy.ts. (role: adjacent task status surface contributor; confidence: medium; commits: b6debb4382f3; files: src/tasks/task-executor-policy.ts)

    Remaining risk / open question:

    • The linked PR now overlaps with the merged review-first subagent handoff, so it needs review or rework against current main before the issue can close cleanly.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against ac99494e443d.

  4. removed
    stale
    on Apr 29, 2026
  5. added
    P2
    clawsweeper:source-repro
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    on May 16, 2026
  6. steipete commented on May 16, 2026

    @steipete
    Contributor

    Fixed on main by squash merge 21244d9 from PR #78985.

    Proof:

    • pnpm docs:list | rg -i "subagents|tools/subagents|agents"
    • pnpm exec oxfmt --check --threads=1 src/agents/subagent-announce.ts src/agents/subagent-announce.format.e2e.test.ts src/tasks/task-registry.ts src/tasks/task-registry.test.ts src/tasks/task-executor-policy.ts src/tasks/task-executor-policy.test.ts
    • node scripts/run-vitest.mjs src/tasks/task-executor-policy.test.ts src/tasks/task-registry.test.ts src/agents/pi-embedded-runner/context-engine-maintenance.test.ts
    • node scripts/run-vitest.mjs --config test/vitest/vitest.e2e.config.ts src/agents/subagent-announce.format.e2e.test.ts
    • codex-review clean against origin/main

    The fix labels delegated ACP/subagent completion handoffs as ready for parent review and routes successful ACP child completions back through the requester session so the parent can verify before calling the original task done. Direct-origin handoffs stay pending for durable retry after restart; non-delegated ACP completions and context-engine maintenance keep ordinary done behavior.

  7. locked as resolved and limited conversation to collaborators on May 19, 2026
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

    P2clawsweeper:linked-pr-openclawsweeper:no-new-fix-prclawsweeper:source-repro

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions