Skip to content

fix(agents): surface failed subagent completion notices - #128512

Merged
obviyus merged 1 commit into
openclaw:mainfrom
Leon-SK668:leon/subagent-failure-notice-20260824
Aug 30, 2026
Merged

obviyus merged 1 commit into
openclaw:mainfrom
Leon-SK668:leon/subagent-failure-notice-20260824

Conversation

@Leon-SK668

@Leon-SK668 Leon-SK668 commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Related to #128449. This pull request fixes the silent direct-notice path only. The issue stays open for its separate attempt-telemetry classification.

What Problem This Solves

A failed subagent can leave a direct requester with no terminal message when requester synthesis fails on the same provider path.

Shipped documentation requires terminal failed subagent runs to announce failure status without replaying captured child text.

Why This Change Was Made

The direct completion fallback accepted only successful child events. The delivery owner already had the trusted child identity, direct target, idempotency key, abort signal, and current source-owner check, but it did not project a failed child into safe fallback content.

The repair:

  • selects the fallback only for one trusted child event with status !== "ok";
  • sends a fixed generic notice through the existing direct completion sender;
  • revalidates cancellation and source ownership immediately before platform delivery; and
  • keeps untrusted, nested, channel, and threaded completions on their existing paths.

User Impact

Direct requesters receive a generic terminal failure notice when both the delegated task and requester-side synthesis fail. The notice does not expose captured child output or provider errors, and non-direct delivery behavior is unchanged.

Evidence

An authenticated ephemeral Gateway ran the production subagent completion flow with a failed child and a requester provider that returned HTTP 500.

Revision Direct result Outbound notices Private child/provider text Non-direct extra sends
Exact main 8e1cda9854ad1cbbb52914d777be9dadd91d0ff9 Retryable and silent 0 Absent 0
Exact head 947a45c4c45b650f57dff8971e753789e229928c Delivered 1 generic notice Absent 0

The exact notice was: A delegated task failed before it could report a result. Please retry the task.

Focused tests: 214/214 passed across the completion delivery owner and subagent announcement coordinator.

Telegram Test Server proof on the exact head drove the same failed-child and failed-requester-synthesis path through a real direct message. The recorder observed the 79-character generic notice exactly once at 6.0 seconds. Ten provider requests included repeated child and requester failures, and neither injected private error string appeared in any Telegram event.

Local E2E setup could not start because the existing worktree dependency tree lacked two build tools. Exact-head CI owns those repository-wide gates.

Scope and risk:

  • Production: +43 net lines across the two existing announcement owners.
  • Tests: +130 lines in the existing delivery-owner suite.
  • No configuration, schema, protocol, persistence, or documented behavior change.

AI Assistance

Codex assisted with repository investigation, implementation, focused validation, and review. No transcript is attached.

@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Aug 24, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 24, 2026
@clawsweeper

clawsweeper Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 30, 2026, 8:06 AM ET / 12:06 UTC.

ClawSweeper review

What this changes

The PR sends a fixed generic direct-chat failure notice when one trusted subagent completion is non-successful and requester-side synthesis also fails, while preserving cancellation and source-ownership fences.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 4 items remain

The prior timeout/unknown gap is fixed and the direct fallback is correctly fenced before platform I/O. Keep this PR open for redacted Telegram Test Server evidence, because the generic user-visible direct-message change can affect Telegram but the supplied proof exercises an ephemeral Gateway rather than Telegram.

Priority: P1
Reviewed head: 947a45c4c45b650f57dff8971e753789e229928c

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation and focused regressions are strong, while Telegram-visible behavior remains unproven.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The supplied authenticated ephemeral-Gateway trace exercises the changed production announcement owner and observes the generic recovery, but this user-visible generic direct-message change can reach Telegram and lacks Telegram Test Server after-fix evidence. Attach redacted userbot proof; after updating the PR body, a fresh review should start automatically, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The supplied authenticated ephemeral-Gateway trace exercises the changed production announcement owner and observes the generic recovery, but this user-visible generic direct-message change can reach Telegram and lacks Telegram Test Server after-fix evidence. Attach redacted userbot proof; after updating the PR body, a fresh review should start automatically, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Introduced fallback selection: The branch accepts exactly one correlated subagent completion and selects the generic failure notice only when its status is not ok; this covers error, timeout, and unknown without using child text.
Final-effect lifecycle fence: The fallback is live-only, carries the abort signal, and rechecks source ownership in the outbound dispatch callback before the shared sender performs platform I/O.
Regression coverage: The changed delivery suite covers error, timeout, and unknown completions, no private-text leakage, cancellation and ownership changes at the outbound seam, untrusted events, and threaded targets.
Findings None None.
Security None None.

How this fits together

A subagent completion enters the announcement coordinator, which first tries requester-side synthesis and then may send a direct fallback to the original requester. This change turns a previously silent failed direct completion into a safe terminal notice without exposing child output.

flowchart LR
  A[Subagent completion] --> B[Announcement coordinator]
  B --> C[Requester synthesis]
  C -->|fails| D[Trusted direct fallback]
  D --> E[Abort and ownership fence]
  E --> F[Direct channel delivery]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The supplied authenticated ephemeral-Gateway trace exercises the changed production announcement owner and observes the generic recovery, but this user-visible generic direct-message change can reach Telegram and lacks Telegram Test Server after-fix evidence. Attach redacted userbot proof; after updating the PR body, a fresh review should start automatically, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P2) - The new generic direct fallback reaches all direct-channel adapters through shared outbound delivery, but the supplied after-fix proof does not show the changed notice on Telegram’s Test Server.
  • Resolve merge risk (P1) - The bug fix adds 43 net production lines; the added content-kind selection and final-effect fence are owner-bound responsibilities, and no smaller absorbing refactor was evident in the existing sender.
  • Complete next step (P2) - No mechanical repair remains: await contributor-supplied Telegram Test Server proof before normal maintainer merge review.
Agent review details

Security

None.

PR surface

Source +43, Tests +130. Total +173 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 48 5 +43
Tests 1 130 0 +130
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 178 5 +173

Review metrics

Metric Value Why it matters
Production versus regression coverage production +43 net; tests +130 The production increase is confined to the direct fallback’s content choice and lifecycle fence, with focused regressions covering the newly reachable failure statuses and dispatch races.

Merge-risk options

Maintainer options:

  1. Add Telegram direct-message proof (recommended)
    Run the failed-child/requester-synthesis-failure scenario on Telegram’s Test Server and attach redacted evidence that exactly one generic notice is delivered.
  2. Accept the transport coverage gap
    Land based on the generic outbound-owner proof while explicitly accepting that Telegram-specific visible delivery was not demonstrated.

Technical review

Best possible solution:

Keep one trusted, direct-only generic fallback at the announcement owner and add redacted Telegram Test Server evidence showing one safe notice after requester synthesis fails, with no notice on a threaded/non-direct control path.

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

Yes—source establishes the prior silent path for a trusted non-ok completion plus a normal requester-synthesis error, and the supplied before/after Gateway trace exercises that scenario. The reviewer did not execute it locally.

Is this the best way to solve the issue?

Yes—the branch repairs the owner of direct completion fallback, uses a bounded non-sensitive notice, and preserves existing non-direct behavior; Telegram-specific visible proof remains the missing merge evidence.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a8c8c8270836.

Labels

Label changes:

  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The supplied authenticated ephemeral-Gateway trace exercises the changed production announcement owner and observes the generic recovery, but this user-visible generic direct-message change can reach Telegram and lacks Telegram Test Server after-fix evidence. Attach redacted userbot proof; after updating the PR body, a fresh review should start automatically, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • add proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The shared direct fallback can visibly send the new terminal notice to Telegram direct chats and should be exercised on Telegram’s Test Server.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.
  • remove status: ⏳ waiting on author: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P1: A failed delegated task can otherwise leave a direct requester without a terminal outcome.
  • merge-risk: 🚨 message-delivery: The patch changes the last-mile direct delivery path for terminal subagent failures across channel adapters.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The supplied authenticated ephemeral-Gateway trace exercises the changed production announcement owner and observes the generic recovery, but this user-visible generic direct-message change can reach Telegram and lacks Telegram Test Server after-fix evidence. Attach redacted userbot proof; after updating the PR body, a fresh review should start automatically, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The shared direct fallback can visibly send the new terminal notice to Telegram direct chats and should be exercised on Telegram’s Test Server.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach redacted Telegram Test Server evidence for one generic direct failure notice and no private child/provider text.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-24T07:12:36.686Z sha 71176410024c6f1f4ac74430552baf3fb33c81ff :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-24T07:49:34.559Z sha 71176410024c6f1f4ac74430552baf3fb33c81ff :: needs changes before merge. :: [P1] Propagate cancellation to the fallback sender
  • reviewed 2026-08-24T08:48:31.524Z sha a88a40c3ec2b653c8ea51ee7869e1eb11c002973 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-25T09:39:33.501Z sha a88a40c3ec2b653c8ea51ee7869e1eb11c002973 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-25T16:42:30.904Z sha 75d8e07a24a26879167ed4a9f31b140d8185b90d :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T11:13:17.262Z sha 6f66d4e7061d58384abc8478f0108fc1893ceb5e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T11:28:21.137Z sha 6f66d4e7061d58384abc8478f0108fc1893ceb5e :: needs changes before merge. :: [P1] Cover timeout and unknown terminal completions
  • reviewed 2026-08-30T11:55:20.148Z sha 6f66d4e7061d58384abc8478f0108fc1893ceb5e :: needs changes before merge. :: [P1] Cover timeout and unknown terminal completions

@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label Aug 24, 2026
@Leon-SK668

Leon-SK668 commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Exact-head maintenance refresh for a88a40c3ec2b653c8ea51ee7869e1eb11c002973.

The redacted mock-Gateway behavior proof still uses an authenticated ephemeral Gateway, real callGateway agent RPC, and production runSubagentAnnounceFlow. It forces requester-agent synthesis to reject after a failed child completion.

{"verdict":"PASS","direct":{"outcome":"delivered","requesterSynthesisRejected":true,"sends":1,"noticeChars":79,"childPrivateContentPresent":false,"providerPrivateContentPresent":false},"nonDirect":{"outcome":"retryable","requesterSynthesisRejected":true,"additionalSends":0}}

The one direct send is the bounded generic notice: A delegated task failed before it could report a result. Please retry the task. The threaded non-direct control records zero additional sends, confirming that the fallback does not bypass that delivery contract.

This head closes the two late lifecycle races identified during review. The direct fallback now carries the request abort signal into outbound delivery and revalidates both cancellation and source ownership immediately before platform I/O. Focused regressions pause inside the outbound seam, then cancel or transfer ownership; both record zero platform sends and return the canonical non-delivery result. Because those authority checks are process-local callbacks, the fallback uses skipQueue: true so durable recovery cannot replay it later without the checks.

Node 24 focused proof: the full src/agents/subagents/announce/subagent-announce-delivery.test.ts passed 192/192. Oxfmt, exact-file oxlint, and git diff --check are clean. Two fresh Codex autoreviews returned no accepted/actionable P0/P1 findings; the final review rated the patch correct at 0.92. The broader local changed gate remains unavailable because this host has no Testbox/Crabbox/Blacksmith runner; exact-head GitHub CI is now running.

The PR remains within the small-fix window at 3 files, +256/-5. It intentionally remains Related to #128449; telemetry classification is still a separate non-goal tracked by the open issue.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: sufficient ClawSweeper judged the real behavior proof convincing. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 24, 2026
@clawsweeper

clawsweeper Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 24, 2026
@clawsweeper

clawsweeper Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 24, 2026
@clawsweeper clawsweeper Bot added the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label Aug 24, 2026
@openclaw-mantis

openclaw-mantis Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Mantis could not complete this proof. Open the failed run.

@obviyus
obviyus force-pushed the leon/subagent-failure-notice-20260824 branch from 75d8e07 to 6f66d4e Compare August 30, 2026 11:05
@openclaw-barnacle openclaw-barnacle Bot added size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed size: M triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 30, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 30, 2026
@obviyus
obviyus force-pushed the leon/subagent-failure-notice-20260824 branch from 6f66d4e to 947a45c Compare August 30, 2026 12:00
@clawsweeper clawsweeper Bot added proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 30, 2026
@obviyus
obviyus merged commit 46c1eef into openclaw:main Aug 30, 2026
270 of 272 checks passed
@obviyus

obviyus commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Leon-SK668!

Proof: An ephemeral Gateway and a Telegram Test Server direct message forced both the delegated run and requester-side synthesis to fail. The requester received the fixed 79-character notice exactly once, no child or provider error text appeared, and a non-direct control sent no extra notice.

  • Bug: A failed delegated run could end silently when requester-side synthesis failed on the same provider path.
  • Fix: The trusted non-success completion now selects one generic direct notice through the existing delivery owner.
  • Safety: Cancellation and source ownership are checked immediately before delivery, so stale work cannot replay the notice.

Example

Before After
The requester could receive no terminal result. The requester receives one generic failure notice with no private error text.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
)

A failed subagent could leave a direct requester without a terminal result when requester-side synthesis failed on the same provider path.

Use the trusted non-success completion event to send one fixed direct notice. Revalidate cancellation and source ownership before platform delivery, keep private failure text out of the notice, and preserve existing non-direct delivery paths.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants