Skip to content

fix(tasks): bound ACP terminal notification details - #151120

Merged
obviyus merged 2 commits into
openclaw:mainfrom
Bartok9:bartok9/acp-task-error-bound-20260917
Sep 19, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
Bartok9:bartok9/acp-task-error-bound-20260917

Conversation

@Bartok9

@Bartok9 Bartok9 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #151006

What Problem This Solves

Fixes oversized ACP background-task failure notices when a backend returns a long diagnostic chain.

User Impact

Failure, lost-task, and blocked-task notifications show a sanitized detail preview of at most 120 characters. Short actionable errors remain visible, and full diagnostics stay in the task record for openclaw tasks show.

Successful completion summaries remain intact, including parent-review messages. Delivery policy, routing, and persistence are unchanged. No new setting or public API is introduced.

Why This Change Was Made

Terminal notices used the existing sanitizer without its display bound. Failed and lost notices now reuse the canonical task-status detail formatter; blocked notices and their follow-ups use the same existing limit. The fix does not truncate the producer's error or successful result.

The registered-lifecycle regression from #151012 is retained with contributor credit and strengthened with a real SQLite reset/reload. Notification tests and their existing fixture are separated from the oversized registry test file without dropping coverage. This PR preserves the original contributor commit.

Evidence

Reproduced on pinned main d879b3f61d11 and verified on this PR through the shipped CLI and an isolated Gateway: gateway call agent → real HTTP model response invoking sessions_spawn(runtime=acp) → registered ACP backend → task notification dispatch. A registered channel adapter delivered direct notices over loopback HTTP; queued notices were observed in the actual parent model's HTTP requests.

Scenario Main This PR
Failed task, direct channel and parent-model routes 1,801-character notice 168-character notice with the actionable sign-in error and ellipsis
Public openclaw tasks show --json Complete 1,753-character canonical error Same complete error
Actual permission-denied task Full blocked diagnostic in the notice Bounded notice; the complete file path remains available through tasks show
Follow-up after inspecting the blocked task Completed Completed and wrote the requested artifact using the recovered full path
Successful completion received by parent model Complete 420-character result Same complete result, not truncated

The registered-lifecycle regression separately verifies that the full diagnostic survives resetting the task registry and reloading from SQLite.

Final focused verification: 197 tests passed across five files, including registered direct/queued delivery, long successful results, blocked follow-ups, short actionable errors, task status, and ACP task ownership. Four-file type-aware lint reported zero warnings/errors. Formatting, whitespace, and the changed-file line-cap ratchet passed.

node scripts/run-vitest.mjs \
  src/tasks/task-registry.notifications.test.ts \
  src/tasks/task-registry.test.ts \
  src/tasks/task-executor-policy.test.ts \
  src/tasks/task-status.test.ts \
  src/acp/control-plane/manager.background-task.test.ts

The ACP backend, model, and channel adapters are synthetic public-SDK plugins, running with private state and loopback HTTP only. No external provider, Telegram client, live Telegram delivery, operator Gateway, or full local repository test matrix was exercised. No production test seam or direct lifecycle injection was used in the CLI proof.

Reuse TASK_STATUS_DETAIL_MAX_CHARS when formatting ACP/background
task failure, blocked, and completion notices so unbounded
formatAcpErrorChain diagnostics stay in the stored task record
instead of flooding the channel (openclaw#151006).
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. size: XS labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. 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 Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 19, 2026, 6:05 AM ET / 10:05 UTC (Revision 3).

ClawSweeper review

What this changes

Bounds failed, lost, and blocked background-task notification details to 120 characters while preserving stored diagnostics and successful results, with documentation and regression coverage.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary: current main and the latest release still have the reported behavior. No blocking patch defect was found, and the updated runtime observations address the previous proof request.

Likely related people
steipete and 100menotu001 are routing candidates based on prior task-formatting work.

Priority: P2
Reviewed head: ea946953ee981087575a13fa744e2b843c254d29

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful lifecycle coverage and relevant production-boundary observations; no blocking correctness finding remains.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body reports the changed formatter exercised through the shipped CLI and isolated Gateway with registered plugins and real loopback HTTP, showing bounded direct/parent notices, complete task inspection, blocked-task recovery, and intact successful output; this satisfies the earlier proof request for the core path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body reports the changed formatter exercised through the shipped CLI and isolated Gateway with registered plugins and real loopback HTTP, showing bounded direct/parent notices, complete task inspection, blocked-task recovery, and intact successful output; this satisfies the earlier proof request for the core path.
Evidence reviewed 9 items Current main still needs the fix: Failed and lost notices still sanitize diagnostics without maxChars; blocked notices and follow-ups are also unbounded.
Latest release retains the same behavior: Inspection of the supplied v2026.9.5 release commit shows the same unbounded terminal formatting.
Introduced change uses the existing display owner: The pinned introduced diff reuses formatTaskStatusDetail for failures/lost tasks and the existing limit for blocked summaries. Successful summaries remain unrestricted. Routing, authorization, persistence, dependencies, and public APIs are unchanged.
Findings None None.
Security None None.

How this fits together

OpenClaw’s task registry tracks background execution and sends terminal updates either directly to a channel or through the requesting conversation. This change formats those updates without changing the underlying task record or delivery routing.

flowchart TD
  A[Background execution] --> B[Task registry]
  B --> C[Complete stored diagnostics]
  C --> D[Task inspection]
  B --> E[Terminal notification formatter]
  E --> F[Direct channel notification]
  E --> G[Requesting conversation]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +7, Tests +164, Docs +5. Total +176 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 1 15 8 +7
Tests 4 238 74 +164
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 258 82 +176

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #151006
Summary: This PR is a candidate fix for the reported unbounded diagnostic notices; another open implementation overlaps the same defect.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep diagnostic previews bounded at the shared presentation owner while retaining complete task records and successful completion output.

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

Yes. Current-main source passes complete long diagnostics into both delivery routes without a display limit; the supplied before/after CLI observations corroborate that path. This reviewer did not execute target code.

Is this the best way to solve the issue?

Yes. Reusing the existing task-status sanitizer and limit is a focused repair, and preserving successful results avoids truncating information the parent needs.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against cc9f1008a3c8.

Labels

Label justifications:

  • P2: Oversized background-task diagnostics are a bounded notification usability defect without demonstrated data loss or runtime failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body reports the changed formatter exercised through the shipped CLI and isolated Gateway with registered plugins and real loopback HTTP, showing bounded direct/parent notices, complete task inspection, blocked-task recovery, and intact successful output; this satisfies the earlier proof request for the core path.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body reports the changed formatter exercised through the shipped CLI and isolated Gateway with registered plugins and real loopback HTTP, showing bounded direct/parent notices, complete task inspection, blocked-task recovery, and intact successful output; this satisfies the earlier proof request for the core path.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The shared formatter changes visible task notices delivered to Telegram, making that chat surface suitable for Test Server userbot demonstration; supplied evidence establishes the core path without claiming Telegram execution.

Evidence

What I checked:

  • Current main still needs the fix: Failed and lost notices still sanitize diagnostics without maxChars; blocked notices and follow-ups are also unbounded. (src/tasks/task-executor-policy.ts:61, cc9f1008a3c8)
  • Latest release retains the same behavior: Inspection of the supplied v2026.9.5 release commit shows the same unbounded terminal formatting. (src/tasks/task-executor-policy.ts:61, ec9c1a13db89)
  • Introduced change uses the existing display owner: The pinned introduced diff reuses formatTaskStatusDetail for failures/lost tasks and the existing limit for blocked summaries. Successful summaries remain unrestricted. Routing, authorization, persistence, dependencies, and public APIs are unchanged. (src/tasks/task-executor-policy.ts:38, ea946953ee98)
  • Production delivery and diagnostic recovery: The delivery owner calls the formatter for direct sends, queued events, and fallback delivery. tasksShowCommand returns the complete task for JSON inspection and includes its error and terminalSummary in text output. (src/tasks/task-registry-delivery.ts:299, ea946953ee98)
  • Updated runtime evidence resolves the prior proof gap: The complete supplied PR body, captured under sourceRevision 70085266cf99768bbfb461b4a7ccf61fc7cdb05cea467b4f38aaefde2acb98a0, reports shipped-CLI → isolated Gateway → HTTP model → registered ACP backend → notification dispatch. Direct HTTP delivery and parent-model requests show notices shrinking from 1,801 to 168 characters, complete 1,753-character diagnostics through tasks show, successful blocked-task recovery, and an unchanged 420-character successful result. This is new production-boundary evidence beyond the earlier mocked-send tests; no external-provider or Telegram execution is claimed. (ea946953ee98)
  • Regression coverage protects output and storage: Registered lifecycle tests cover both notification routes and verify the full error after SQLite reset/reload. Existing delivery tests now protect long successful results and bounded blocked follow-ups. The new suite is assigned to the database-worker lane. Tests were inspected, not executed during this read-only review. (src/tasks/task-registry.notifications.test.ts:117, ea946953ee98)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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 (2 earlier review cycles)
  • reviewed 2026-09-17T20:38:55.782Z sha f693aab :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-19T08:32:44.791Z sha ea94695 :: needs real behavior proof before merge. :: none

Preserve complete stored diagnostics and successful completion output. Verify direct and queued notices through registered task lifecycle delivery and a SQLite reload.

Co-authored-by: Jackten <[email protected]>
@obviyus
obviyus requested review from a team as code owners September 19, 2026 08:25
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web channel: zalo Channel integration: zalo channel: zalouser Channel integration: zalouser labels Sep 19, 2026
@obviyus

obviyus commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-unrelated-red
pr: 151120
head: ea94695
run: 35432052655 attempt: 1
failed: checks-node-compact-large-2 job=105868386448 conclusion=failure
check: openclaw/ci-gate

@obviyus

obviyus commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Landed the diagnostic-only repair. Failed, lost, and blocked task notices now use the existing sanitized preview limit; full stored diagnostics and successful completion results remain intact.

The shipped CLI/Gateway flow reproduced 1,801-character notices on main and 168-character notices after the fix, both through real loopback channel delivery and parent-model HTTP receipt. Public tasks show retained the complete 1,753-character error. An actual permission-denied task was inspected through that command, then a new ACP request used the recovered full path to complete the write; the parent received the full 420-character successful result. These were isolated synthetic SDK backends, not a live Telegram or external-provider run.

Focused validation passed 197 tests. The fresh exact-head canonical review cleared correctness, security, and product-path proof. Hosted CI's sole source failure was the unrelated registered CLI watchdog cancellation/agent.wait timeout; its complete settled attempt was retained and handled through the native unrelated-red approval, not relabeled green or retried.

Thanks @Bartok9 for the original fix and @Jackten for the report and registry-boundary regression coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ACP task failure notices include unbounded diagnostics

2 participants