Repository navigation
fix: resolve issue #156888 β Web Push re-sends "background task failed" for an already-failed subagent task on every gateway restart - #156989
Conversation
|
π¦π Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 24, 2026, 2:52 AM ET / 06:52 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch makes Gateway task broadcasts mark eligible failure transitions so Web Push skips replayed failures and silent tasks, and adds regression tests. Merge readinessβ Blocked before merge - 2 items remain The reported duplicate alert is still possible on current main, and this PR addresses its Gateway path. The patch has no identified blocking code defect, but the after-fix evidence does not yet show the requested outcomes through a real Web Push client. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway receives task-registry changes and broadcasts task updates to connected clients. Its Web Push path turns eligible updates into offline browser notifications after checking recipients and preferences. flowchart LR
A[Task registry change] --> B[Gateway task subscription]
B --> C{New failure and not silent?}
C --> D[Task broadcast]
D --> E[Web Push eligibility and recipient checks]
E --> F[Browser notification]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +25, Tests +314. Total +339 across 8 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep task-transition eligibility with the Gateway task owner and establish, through a redacted browser or real transport trace, that genuine failures alert once while restart replays and silent tasks do not alert. Do we have a high-confidence way to reproduce the issue? Yes. The reported retained-failure replay reaches a current-main classifier that pushes on any failed task upsert; the contributor supplied a before-fix failure trace, though this review did not execute the path. Is this the best way to solve the issue? Yes, provisionally. The existing task subscription knows the transition and silence policy, so passing that fact to the Web Push classifier is a narrow repair; real-client after-fix behavior remains unproven. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1f01706bc75c. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
7329e2a to
8948322
Compare
The gateway task subscription re-projects retained terminal task rows on restore, and the offline Web Push classifier pushed for any failed/timed_out task upsert. As a result a task that failed days earlier re-sent "OpenClaw background task failed" on every gateway restart, and a task whose spawner set notify_policy: silent pushed anyway. Gate the task Web Push on a genuine non-terminal -> terminal transition whose spawner did not request silence. The subscription owner already computes that predicate and sees the full task record, so it passes the fact as internal, never-serialized broadcast metadata. The ordinary client task broadcast is unchanged. Fixes openclaw#156888
8948322 to
9f3fcdd
Compare
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix: resolve issue #156888 β Web Push re-sends "background task failed" for an already-failed subagent task on every gateway restart This is item 3/3 in the current shard. Shard 56/89. This temporary status tracks the active review worker. The completed review will appear in the durable ClawSweeper review comment. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Closing as superseded by #159179 ( What that means for this branch:
So the behavior reported in #156888 can no longer occur on Re-verified on Superseded, no code change needed here. Thanks for the review. |
What Problem This Solves
Issue #156888: Web Push re-sends "background task failed" for an already-failed subagent task on every gateway restart
Version: 2026.9.5 (Docker, Linux) Β· multi-user gateway (
gateway.rolesset) Β· Web Push enabled from a browser PWAWhat happens
After every gateway restart, each subscribed browser receives "OpenClaw background task failed" for a subagent task that failed days earlier. No task failed at restart time. It repeats on each restart, for as long as the run stays in the subagent registry.
Repro
label: plugin:workboard,cleanup: "keep", requesteragent:<id>:main, ended 2026-09-22 withoutcome.status: error,cleanupHandled: trueandcleanupCompletedAtset. Itstask_runsrow isstatus: failed,notify_policy: silent,cleanup_after: 2026-09-29.tag: openclaw-task-failed-<that task id>.We logged every push the service worker received, on staging:
02:46:10openclaw-agent-finished-β¦: a real reply, received once (so replies are not duplicated);02:46:31gateway SIGTERM / restart;02:47:59openclaw-task-failed-37ae8f01-β¦: the task that failed on 2026-09-22;tasks.listshows no newer failure.Why This Change Was Made
What the issue reports
With Web Push enabled, every subscribed browser receives a
OpenClaw background task failednotification after each gateway restart for asubagent task that failed days earlier. No task fails at restart time. The
notification repeats on every restart for as long as the retained run exists
(up to the 7-day retention window). Separately, the affected task had
notify_policy: silent(its spawner asked it to stay quiet), yet Web Pushignored that and pushed anyway on the first, real failure.
Reproduction (already recorded locally, deterministic):
/workspace/bot/logs/reproduction/issue-156888-evidence/(
before-fix-terminal.txt,repro-issue-156888.test.ts,repro-issue-156888.log)upserted previous=failed next=failed-> 1 broadcast -> 1 Web Push.notifyPolicy: "silent"task failing once -> 1 push (expected 0).Actual behavior
Observed on
mainatc6b21f6f086:User Impact
See the linked issue for the reported before/after behavior; this change is limited to the paths shown in the PR diff.
Evidence
Real behavior proof through the product entry point, before and after this change.
Every command below was executed in the reproduction container (see Environment).
After fix β the same entry point runs to completion:
Before fix β reproduction of the reported failure:
Environment (reproduction container):
What was not tested:
Artifacts:
/media/vdb/AutoDigit/workspace/logs/reproduction/issue-156888-evidence/media/vdb/AutoDigit/workspace/logs/reproduction/issue-156888-analysis.log/media/vdb/AutoDigit/workspace/logs/real_behavior/issue-156888-evidence/media/vdb/AutoDigit/workspace/logs/real_behavior/issue-156888-evidence/terminal-output.txt/media/vdb/AutoDigit/workspace/logs/real_behavior/issue-156888-fix.log/media/vdb/AutoDigit/workspace/logs/reproduction/container-tools.txtLocal validation commands:
Linked context
Closes #156888
Tests and validation
Commands run (local CI equivalent checks):
Local CI equivalent check report:
Risk checklist
Current review state
π€ AI Participation Disclosure
π€ AI-assisted: This PR was developed with AI assistance (opencode + auto_fix_bot).
Development Process
Problem Reproduction (Human-led)
Solution Generation (AI-led, Human-decided)
/media/vdb/AutoDigit/workspace/logs/opencode/issue-156888-solutions.mdImplementation (AI-led)
Validation (Human-led)
Role Breakdown
Human contributions:
AI contributions:
Rollback Plan
Risk Level: Low
Rollback command:
Observable failure symptoms:
Appendix: Evidence Directories
/media/vdb/AutoDigit/workspace/logs/reproduction/issue-156888-evidence/media/vdb/AutoDigit/workspace/logs/real_behavior/issue-156888-evidence/media/vdb/AutoDigit/workspace/logs/reproduction/issue-156888-analysis.log/media/vdb/AutoDigit/workspace/logs/real_behavior/issue-156888-fix.log/media/vdb/AutoDigit/workspace/logs/real_behavior/issue-156888-evidence/terminal-output.txt/media/vdb/AutoDigit/workspace/logs/opencode/issue-156888-solutions.mdCloses #156888.