Skip to content

fix(slack): report failed terminal session status updates - #145778

Merged
obviyus merged 5 commits into
openclaw:mainfrom
Alix-007:alix/b4-slack-terminal-status-diagnostics-20260911
Sep 19, 2026
Merged

obviyus merged 5 commits into
openclaw:mainfrom
Alix-007:alix/b4-slack-terminal-status-diagnostics-20260911

Conversation

@Alix-007

@Alix-007 Alix-007 commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Related: #142772. This fixes terminal API-failure diagnostics, not Slack Desktop's working-indicator behavior.

What Problem This Solves

Fixes silent Slack session-status cleanup failures when Slack accepts processing but rejects the terminal active update.

User Impact

Operators receive one normal-level diagnostic and can enable verbose logging for the underlying Slack API failure. Rejected or unsupported processing writes do not produce this new diagnostic. Status requests, cleanup ordering and retry behavior are unchanged; typing reactions are still removed. No configuration or migration is required.

An accepted status request is not proof that Slack Desktop has refreshed its UI, so the broader issue remains open.

Why This Change Was Made

Preserve API acceptance through the existing monitor context and consume it in the existing dispatch cleanup owner. A successful write remains successful when another agent keeps Slack's aggregate status at processing, or when a subsequent title rename fails. The diagnostic contains no token, channel/thread identifiers, title or raw API error.

The integration preserves current main's inferred context type rather than restoring its retired type file, and updates the existing delivery-trace fixture to the same acceptance contract. Unnecessary helper logging and wording-pinned test assertions were removed.

Evidence

Actual before/after proof ran on Linux arm64 / Node 24.19.0 through the supported Gateway CLI, the registered signed Slack HTTP webhook, real agent dispatch and typing callbacks, and the installed Slack WebClient against a loopback API. Only external Slack/model endpoints were fixtures; the monitor, dispatch, context, SDK response handling and normal file logger were real.

Scenario Baseline diagnostics Candidate diagnostics
Processing accepted, active rejected 0 1
Both writes accepted 0 0
Processing rejected 0 0
Active accepted, aggregate still processing 0 0

Every scenario delivered the scripted final reply, wrote processing then active exactly once, and completed typing-reaction cleanup. Each isolated Gateway was stopped before reading its log. The baseline failed the required diagnostic assertion; the candidate passed the same driver.

Observed normal-level error:

Slack session status could not return to active after processing. Enable verbose logging to inspect the Slack API failure.
  • Baseline: 7a932d9794421961e45a4715b08d63db74b7fb2d; the affected owners were unchanged on subsequently checked main 2e053112b61f34964d4b0c360e3562c71f728e99.
  • Candidate: 947b7bd6622af803009bf9ce31b772ec6b2777e1; committed production hashes match the observed runtime.
  • Regression on unmodified baseline: 4 expected failures and 5 passing controls. The candidate also covers no thread, repeated cleanup, quiet accepted/aggregate-status controls, privacy, failed title rename, and cleanup when the logger throws.
  • 501 focused tests passed across seven files: 471 Slack tests and 30 shared typing lifecycle tests. The nine diagnostic cases and real Gateway flow were rerun after final message-guidance cleanup. Media fixtures used deterministic DNS inside the network-isolated container; no media or network-policy source was changed.
  • Targeted type-aware Oxlint, Oxfmt, counted-line growth check and git diff --check passed. Full static/matrix validation remains hosted.
node scripts/run-vitest.mjs \
  extensions/slack/src/monitor/message-handler/dispatch.status-diagnostics.test.ts \
  extensions/slack/src/monitor/context.test.ts \
  extensions/slack/src/monitor/message-handler/dispatch.preview-fallback.test.ts \
  extensions/slack/src/monitor/message-handler/prepare.test.ts \
  extensions/slack/src/monitor/events/agent.test.ts \
  extensions/slack/src/delivery-trace.test.ts \
  src/channels/typing.test.ts

No live Slack workspace or Desktop rendering was exercised, and no retry, status reordering, dependency, schema or permission change is included.

@clawsweeper

clawsweeper Bot commented Sep 12, 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 channel: slack Channel integration: slack size: M labels Sep 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 19, 2026, 4:29 AM ET / 08:29 UTC (Revision 5).

ClawSweeper review

What this changes

The Slack plugin reports failed terminal status updates after accepted processing updates, with regression coverage and troubleshooting guidance.

Merge readiness

✅ Ready for maintainer review

This focused diagnostic fix remains absent from current main and the latest release. Production-path proof supports it, and no blocking introduced defect was found.

Priority: P2
Reviewed head: 947b7bd6622af803009bf9ce31b772ec6b2777e1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with strong production-boundary evidence and no blocking findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The captured body records the real Gateway webhook, dispatch/context owners, WebClient, and file logger exercising injected terminal failure: the candidate logs once, controls remain quiet, and replies plus reaction cleanup complete. This proves the diagnostic boundary, not Slack Desktop rendering.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The captured body records the real Gateway webhook, dispatch/context owners, WebClient, and file logger exercising injected terminal failure: the candidate logs once, controls remain quiet, and replies plus reaction cleanup complete. This proves the diagnostic boundary, not Slack Desktop rendering.
Evidence reviewed 10 items Current main still lacks the diagnostic: Current main discards the context result and awaits the active write without inspecting acceptance. The context, dispatch setup, and session-status blobs match the PR merge-base versions.
Latest-release comparison: The supplied v2026.9.5 release commit has the same dispatch-setup and session-status blobs as current main, so that release also lacks this diagnostic.
Narrow production change: Cleanup consumes the internal context's boolean acceptance result, emits a fixed diagnostic only after accepted processing, and protects subsequent reaction removal from logger exceptions. The public Slack API barrel does not expose this context method; no public plugin API, credentials, permissions, persistence, or request policy changes.
Findings None None.
Security None None.

How this fits together

The Slack plugin translates agent-turn activity into Slack session status requests. Its cleanup path restores active status and removes typing reactions; this change exposes unsuccessful restoration to operators.

flowchart TD
  A[Slack message] --> B[Agent turn]
  B --> C[Processing status request]
  C --> D[Remember API acceptance]
  B --> E[Turn cleanup]
  D --> E
  E --> F[Active status request]
  F --> G[Report failure when processing succeeded]
  G --> H[Remove typing reaction]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +14, Tests +202, Docs +7. Total +223 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 2 18 4 +14
Tests 5 215 13 +202
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 240 17 +223

Review metrics

Metric Value Why it matters
Production versus test growth production net +14 lines; tests net +202 lines The small production increase carries API acceptance into existing cleanup; test growth covers failure reporting and quiet-control behavior.

Technical review

Best possible solution:

Keep failure reporting in the existing Slack cleanup owner, preserving request behavior and quiet handling of unsupported sessions.

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

Yes: accepted processing followed by a rejected active request reaches a source-proven silent failure on current main. The contributor records a matching before/after Gateway run; this review did not execute it.

Is this the best way to solve the issue?

Yes: preserving acceptance through the existing internal context and reporting at cleanup is a narrow fix that avoids speculative retries or status reordering.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs a bounded Slack observability gap without changing message delivery or status request policy.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The captured body records the real Gateway webhook, dispatch/context owners, WebClient, and file logger exercising injected terminal failure: the candidate logs once, controls remain quiet, and replies plus reaction cleanup complete. This proves the diagnostic boundary, not Slack Desktop rendering.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records the real Gateway webhook, dispatch/context owners, WebClient, and file logger exercising injected terminal failure: the candidate logs once, controls remain quiet, and replies plus reaction cleanup complete. This proves the diagnostic boundary, not Slack Desktop rendering.

Evidence

What I checked:

  • Current main still lacks the diagnostic: Current main discards the context result and awaits the active write without inspecting acceptance. The context, dispatch setup, and session-status blobs match the PR merge-base versions. (extensions/slack/src/monitor/message-handler/dispatch-setup.ts:213, ec7c47a6d508)
  • Latest-release comparison: The supplied v2026.9.5 release commit has the same dispatch-setup and session-status blobs as current main, so that release also lacks this diagnostic. (extensions/slack/src/monitor/message-handler/dispatch-setup.ts:213, ec9c1a13db89)
  • Narrow production change: Cleanup consumes the internal context's boolean acceptance result, emits a fixed diagnostic only after accepted processing, and protects subsequent reaction removal from logger exceptions. The public Slack API barrel does not expose this context method; no public plugin API, credentials, permissions, persistence, or request policy changes. (extensions/slack/src/monitor/message-handler/dispatch-setup.ts:214, 947b7bd6622a)
  • Captured production-path proof: The complete supplied body, sourceRevision ff69cb1e91be5fd79697fe951f2a80f053d8b4a01feabea51a97f272a3e37b54, records Linux arm64/Node 24.19.0 Gateway runs through a signed Slack HTTP webhook, real dispatch/context/typing owners, installed WebClient, and normal file logger against loopback external endpoints. Accepted processing followed by rejected active produced zero baseline diagnostics and one candidate diagnostic; three controls stayed quiet. All scenarios delivered replies and removed typing reactions. This is contributor-recorded proof, not execution performed during this review. (947b7bd6622a)
  • Regression coverage and lifecycle: Nine new cases cover failure visibility, privacy, unsupported processing, accepted writes, aggregate status, repeated or premature cleanup, absent threads, logger failure, and rename failure. The shared typing owner waits for an in-flight start before terminal stop. Tests were inspected but not executed in this read-only review; diff whitespace validation passed. (extensions/slack/src/monitor/message-handler/dispatch.status-diagnostics.test.ts:126, 947b7bd6622a)
  • Prior-review continuity: The previous completed review retained no findings or published rank-up moves. GitHub's parent-to-head comparison confirms the latest commit only corrects diagnostic and documentation wording about existing SDK retries. REST comparison supplied this evidence after local historical blob inspection was unavailable. (extensions/slack/src/monitor/message-handler/dispatch-setup.ts:228, 947b7bd6622a)

Likely related people:

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

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-12T07:45:25.003Z sha 4ef8a6f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T08:13:57.391Z sha 336e6a2 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T03:14:17.494Z sha d8b8d8a :: needs maintainer review before merge. :: none
  • reviewed 2026-09-19T08:20:18.055Z sha c60681a :: needs maintainer review before merge. :: none

@obviyus
obviyus requested review from a team as code owners September 19, 2026 08:12
@obviyus obviyus closed this Sep 19, 2026
@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: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web labels Sep 19, 2026
@obviyus

obviyus commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Landed in 5a36317.

Slack now reports a failed terminal active update after accepted processing. The signed Gateway → real WebClient loopback proof changed the missing diagnostic from 0 to 1 while preserving quiet controls, final replies and reaction cleanup. All 501 focused tests passed, required hosted CI was green, and the exact-head review was clean.

This is a diagnostic repair only. #142772 remains open; no Slack Desktop indicator fix is claimed.

Thanks @Alix-007 for the contribution and @joncursi for the related report.

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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

2 participants