Skip to content

fix(slack): progress card keeps a recovered tool failure red after the turn succeeds - #137523

Merged
steipete merged 1 commit into
mainfrom
slack-progress-recovered-attention
Sep 3, 2026
Merged

steipete merged 1 commit into
mainfrom
slack-progress-recovered-attention

Conversation

@steipete

@steipete steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Closes #137491
Related: #39406

What Problem This Solves

Fixes an issue where Slack users running streaming.mode: "progress" would see a completed turn whose progress card still carried a red Bash — exit 1 style attention row when a tool call had failed earlier in the turn but the agent retried successfully and finished the work. The final answer said the task was done while the card next to it still signaled failure, so people interrupted or re-ran work that had already succeeded. Reported by @joncursi in #137491, with an operator screenshot of the same symptom on the Block Kit session card in #39406.

Why This Change Was Made

The shared progress compositor intentionally keeps attention lines for the whole turn, and Slack native task rows cannot be removed, only updated. The Slack progress presentation never reconciled that row at completion, so it stayed error forever. The terminal-state decision now lives in one place in the Slack progress presentation: while the turn is working a failure is still a red attention row; when the turn completes successfully the row settles as Recovered: <failure> with complete status (native card) or a Recovered: … line (Block Kit card); when the turn fails the red row stays. Pending approvals at completion are retired the same way as before, now through the same helper instead of two caller-side filters. No configuration was added and the compositor, reconciler, and dispatch code are unchanged.

User Impact

A Slack progress card whose turn completed successfully no longer looks failed. Operators still see that a transient failure happened (the row reads Recovered: …), and turns that actually fail keep the red row. Docs for the Slack progress mode describe the behavior.

Evidence

  • extensions/slack/src/progress-blocks.test.ts: native sequence (failed command → error row → completion settles it as Recovered: … / complete; failed completion keeps error), Block Kit card for working/success/error states, and pending approval retirement at completion. The new assertions fail on main (3 failures: missing recovered update in both native paths, raw failure title on the success card).
  • extensions/slack/src/monitor/message-handler/dispatch.preview-fallback.test.ts: boundary run through the real Slack dispatch path with a nonzero-exit command_output event followed by a successful final reply; the openclaw_attention task updates sent to Slack are exactly [error, Recovered … complete].
  • Local: pnpm test extensions/slack 2,746 passed; pnpm check:changed passed; Codex autoreview (branch vs origin/main, P0/P1) scoped-clean.
  • Live Slack proof gap: this session has no leased Slack QA bot pair, so no live capture of the settled card was taken. The dispatch harness asserts the exact task_update chunk payloads the Slack plugin sends.

A tool failure during a Slack progress turn became a red
openclaw_attention row that stayed red even when a retry succeeded and
the turn completed, because native task rows cannot be removed and the
presentation never reconciled them. Successful completion now settles
the failure row as "Recovered: …" (complete) in native cards and in the
Block Kit session card; failed turns keep the red row.

Fixes #137491
Refs #39406
Reported-by: @joncursi
@steipete
steipete marked this pull request as ready for review September 3, 2026 19:47
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: slack Channel integration: slack size: S maintainer Maintainer-authored PR labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Prepared unchanged at 406adb3116f83eacb9af313caf341b7b0a9b4816 through the native review/artifact/prepare flow. Exact-head CI run 33798506344 passed, and node scripts/watch-pr-ci.mjs 137523 406adb3116f83eacb9af313caf341b7b0a9b4816 returned GREEN. No fixes, rebases, or CI retries were needed.

The lead accepted these local checks before handing off landing:

  • pnpm test extensions/slack/src/progress-blocks.test.ts extensions/slack/src/monitor/message-handler/dispatch.preview-fallback.test.ts: 192 passed; the three new regressions failed before the fix.
  • pnpm test extensions/slack: 2,746 passed across 147 files.
  • pnpm check:changed: passed.
  • Codex autoreview against origin/main, P0/P1: scoped-clean.

OPENCLAW_TESTBOX=1 scripts/pr prepare-run 137523 passed using hosted CI/Testbox evidence and confirmed the remote head already matched. The known proof gap remains as documented in the PR body: no live Slack capture; the dispatch harness asserts the exact recovered task updates. ClawSweeper's review is still running and will be read before merge.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 3, 2026, 3:56 PM ET / 19:56 UTC.

ClawSweeper review

What this changes

The PR updates Slack progress cards so a tool failure followed by a successful turn is shown as recovered rather than as a terminal error.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: this protected, maintainer-authored PR cleanly repairs a current Slack presentation defect. No blocking patch defect was found; explicit maintainer handling remains required.

Priority: P2
Reviewed head: 406adb3116f83eacb9af313caf341b7b0a9b4816
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused shared-owner fix with direct and dispatch-boundary regression coverage, documentation alignment, and no blocking correctness or security concern.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its dispatch-boundary coverage nevertheless asserts the native task-update sequence sent by the changed presentation owner. The PR records that no leased Slack QA bot pair was available for a live card capture.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its dispatch-boundary coverage nevertheless asserts the native task-update sequence sent by the changed presentation owner. The PR records that no leased Slack QA bot pair was available for a live card capture.
Evidence reviewed 7 items Current-main defect: Current main's attention resolver identifies failed tool lines but always returns an error status, even though the stream builder separately receives terminal status.
Shipped behavior: The latest stable release, v2026.8.2, contains the same always-error attention rendering, establishing the report as an existing shipped behavior defect.
Shared-owner repair: The PR passes terminal status into the shared attention resolver, retaining error on failed turns and changing successful terminal rendering to a completed Recovered row.
Findings None None.
Security None None.

How this fits together

Slack’s progress presentation converts tool and turn lifecycle events into native task-card updates or Block Kit sections. It receives structured progress lines and terminal status, then renders the state shown beside the assistant reply.

flowchart LR
  A[Tool lifecycle events] --> B[Progress compositor]
  B --> C[Slack progress presentation]
  D[Turn terminal outcome] --> C
  C --> E[Native task-card updates]
  C --> F[Block Kit progress card]
  E --> G[Slack user view]
  F --> G
Loading

Decision needed

Question Recommendation
Should this protected, maintainer-authored Slack presentation repair be approved after the remaining exact-head checks complete? Approve after CI: Accept the shared terminal-state rendering once the remaining exact-head checks pass.

Why: Repository policy keeps maintainer-authored and maintainer-labeled items open for explicit human handling even when the patch is otherwise correct.

Before merge

  • Resolve merge risk (P1) - Production code grows by five net lines; the added terminal-status parameter and recovered title consolidate prior caller-side filtering, and no net-neutral form was evident without reintroducing duplicate presentation policy.
  • Complete next step (P2) - Obtain explicit maintainer review for this protected, maintainer-authored user-visible change.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +5, Tests +66, Docs 0. Total +71 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 20 15 +5
Tests 2 86 20 +66
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 107 36 +71

Review metrics

Metric Value Why it matters
Production vs test LOC production +20/-15 (net +5), tests +86/-20, docs +1/-1 The small production increase centralizes terminal-state rendering; most changed lines provide focused regression coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #137491
Summary: This PR is a candidate fix for the narrowly reported native Slack-card terminal-state defect; the broader tool-warning configuration request is distinct.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep terminal status centralized in the shared Slack attention renderer, with red error rows for failed turns and completed recovered rows for successful ones, after explicit maintainer review.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep terminal status centralized in the shared Slack attention renderer, with red error rows for failed turns and completed recovered rows for successful ones, after explicit maintainer review.

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

Yes—source inspection provides a high-confidence reproduction shape: a failed progress line persists through a successful terminal update on current main, and the added tests model that exact order.

Is this the best way to solve the issue?

Yes—the shared presentation helper is the narrowest owner covering both native and Block Kit cards, while its callers already provide the authoritative final success/error outcome.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: The patch corrects a Slack-specific presentation defect that can make completed work appear to have failed.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its dispatch-boundary coverage nevertheless asserts the native task-update sequence sent by the changed presentation owner. The PR records that no leased Slack QA bot pair was available for a live card capture.

Label justifications:

  • P2: The patch corrects a Slack-specific presentation defect that can make completed work appear to have failed.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its dispatch-boundary coverage nevertheless asserts the native task-update sequence sent by the changed presentation owner. The PR records that no leased Slack QA bot pair was available for a live card capture.

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)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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.

@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

The completed ClawSweeper review has no actionable code findings and no separate Rank-up moves: list. Its remaining before-merge items are resolved:

  • Production net +5: accepted in the completed lead review. Terminal-state handling stays in the shared Slack attention renderer and removes duplicate caller-side approval filtering; the review itself found no net-neutral form that avoided duplicating policy. No further rewrite is needed.
  • Explicit maintainer review and decision: already completed. The maintainer's work order explicitly states that review and autoreview were accepted, the land decision is made, and this unchanged commit is to be published and landed.
  • Exact-head checks: CI 33798506344 passed at 406adb3116f83eacb9af313caf341b7b0a9b4816; the native watcher returned GREEN and native preparation passed.

No behavior change or re-review request is needed. The live Slack capture gap remains recorded in the original PR body.

@steipete
steipete merged commit 1527556 into main Sep 3, 2026
203 of 210 checks passed
@steipete
steipete deleted the slack-progress-recovered-attention branch September 3, 2026 20:02
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
openclaw#137523)

A tool failure during a Slack progress turn became a red
openclaw_attention row that stayed red even when a retry succeeded and
the turn completed, because native task rows cannot be removed and the
presentation never reconciled them. Successful completion now settles
the failure row as "Recovered: …" (complete) in native cards and in the
Block Kit session card; failed turns keep the red row.

Fixes openclaw#137491
Refs openclaw#39406
Reported-by: @joncursi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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]: Slack native progress card retains recovered tool failure as a terminal red attention row

1 participant