Skip to content

feat(slack): add compact commentary progress - #126480

Merged
sjf-oa merged 10 commits into
mainfrom
sjf/slack-compact-commentary
Aug 20, 2026
Merged

sjf-oa merged 10 commits into
mainfrom
sjf/slack-compact-commentary

Conversation

@sjf-oa

@sjf-oa sjf-oa commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #126477

What Problem This Solves

Slack progress mode currently selects either native task cards or a Block Kit session card. Both surfaces add structured labels, rows, icons, and timing metadata, so operators cannot choose a quiet presentation that shows only assistant commentary. The Block Kit fallback also sends the final answer as a separate message instead of replacing the progress message.

Why This Change Was Made

This adds a Slack-specific channels.slack.streaming.progress.style setting with "card" as the backward-compatible default and "compact" as an opt-in. Compact style bypasses both card renderers and reuses Slack's existing editable text-preview finalization path, so eligible final text replaces the commentary message in place. Existing safe fallbacks remain unchanged for media, errors, oversized or split payloads, custom outbound identity, and edit failures.

The Slack runtime reads the setting through the typed SlackAccountConfig contract. The generic progress rendering surface stays unchanged because this presentation choice is specific to Slack's native and Block Kit card alternatives.

User Impact

Slack operators can configure tool progress as italic commentary only, without a commentary label, bullets, emoji, tool rows, or elapsed time:

{
  channels: {
    slack: {
      streaming: {
        mode: "progress",
        progress: {
          style: "compact",
          label: false,
          commentary: true,
          toolProgress: false,
        },
      },
    },
  },
}

The default card behavior is unchanged when style is omitted.

Evidence

  • The deterministic Slack delivery trace records an italic chat.postMessage, a second commentary update via chat.update on the same timestamp, and the final answer via another chat.update on that same message.
  • Live Slack E2E evidence is attached in this PR comment: one commentary message was edited in place to the final answer with no second bot response.
  • node scripts/run-vitest.mjs extensions/slack/src/delivery-trace.test.ts extensions/slack/src/monitor/message-handler/dispatch.preview-fallback.test.ts extensions/slack/src/config-schema.test.ts src/config/schema.test.ts src/config/types.slack.test.ts src/plugin-sdk/channel-config-ui-hints.test.ts — 269 passed across three shards.
  • ./node_modules/.bin/oxfmt --check ... and ./node_modules/.bin/oxlint ... on the changed TypeScript files — passed.
  • ./.agents/skills/autoreview/scripts/autoreview --mode local — clean, no accepted/actionable findings.
  • The earlier full changed gate passed formatting, generated metadata, SDK boundaries, core typecheck, and core-test typecheck. Repository-wide extension typecheck was blocked by an unrelated current-main error in extensions/acpx/src/service.ts: TS2353: 'elicitationModes' does not exist in type 'OpenClawAcpxRuntimeOptions'. That file is unchanged by this PR.

AI-assisted: Codex implemented and validated this change; I reviewed the behavior and understand the implementation.

@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@sjf-oa
sjf-oa marked this pull request as ready for review August 19, 2026 23:39
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: slack Channel integration: slack size: S maintainer Maintainer-authored PR labels Aug 19, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 19, 2026
@clawsweeper

clawsweeper Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 20, 2026, 5:53 PM ET / 21:53 UTC.

ClawSweeper review

What this changes

Adds an opt-in Slack streaming.progress.style: "compact" setting that displays one editable commentary draft and replaces it with an eligible final text response.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking correctness finding remains: the prior shared-compositor regression is fixed by keeping plan suppression in Slack compact mode. This adds a public Slack configuration contract, so it remains open for maintainer product acceptance and exact-head CI.

Priority: P3
Reviewed head: f22df38b953b646c6aa79bee6ce5a18e84532727
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The real Slack proof and focused coverage support a clean Slack-local implementation; public configuration acceptance and exact-head CI remain.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): A real Slack-app run shows one commentary message edited in place to the final response; the later exact-head change only moves plan suppression into the Slack runtime.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): A real Slack-app run shows one commentary message edited in place to the final response; the later exact-head change only moves plan suppression into the Slack runtime.
Evidence reviewed 6 items Typed Slack configuration: The Slack-owned strict progress schema accepts only card or compact; omission remains optional and resolves to card style in the runtime.
Slack-local P2 repair: Compact mode bypasses only Slack’s plan callback, while all other progress styles continue to call the shared compositor.
Shared invariant retained: The added compositor regression test proves plans remain visible when generic toolProgress is false; this is the behavior the previous review required preserving for non-Slack callers.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

pnpm openclaw --help
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126480-dTC4cP/target$ pnpm openclaw --help
$ node scripts/run-node.mjs --help
pnpm openclaw --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 105.10 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

[tsdown-build] invocation 2/2 finished in 13.8s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 10 phases completed in 4225ms (slowest: built plugin control-plane loads 3493ms)

OpenClaw 2026.8.1 (f22df38) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console
… output truncated …

Assertions:

  • PASS expect_output: Usage:

How this fits together

The Slack plugin translates agent progress callbacks into Slack cards, drafts, and final messages. This adds a Slack-only choice between existing card presentation and an editable compact draft while preserving normal final-delivery fallbacks.

flowchart LR
A[Agent progress callbacks] --> B[Slack progress runtime]
B --> C{Configured style}
C -->|Card| D[Native or Block Kit card]
C -->|Compact| E[Editable commentary draft]
D --> F[Slack message delivery]
E --> F
F --> G[Final edit or safe fallback]
Loading

Decision needed

Question Recommendation
Should OpenClaw maintain channels.slack.streaming.progress.style: "compact" as a public Slack presentation contract? Accept the opt-in Slack style: Ship compact as the documented Slack-only option while retaining card presentation as the default.

Why: The patch is technically bounded, but it adds a new persisted operator-facing mode rather than repairing an established behavior contract.

Before merge

  • Resolve merge risk (P2) - This creates a persistent public Slack presentation option; maintainers must intentionally own the card default, compact semantics, and documented fallback behavior as an upgrade-stable contract.
Agent review details

Security

None.

PR surface

Source +40, Tests +196, Docs +24, Generated 0. Total +260 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 7 47 7 +40
Tests 6 210 14 +196
Docs 2 27 3 +24
Config 0 0 0 0
Generated 1 8 8 0
Other 0 0 0 0
Total 16 292 32 +260

Review metrics

Metric Value Why it matters
Public configuration surface 1 added Slack-only enum: progress.style (card | compact) This is a new persisted operator setting whose omitted value must continue to select card mode.
Production and test delta production +36/-7; tests +210/-14; docs +27/-3; generated metadata +8/-8; trace support +11/-0 The production growth implements one Slack-only opt-in capability; test and trace coverage exercise the delivery boundary and shared compositor invariant.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/config/bundled-channel-config-metadata.generated.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #126477
Summary: This PR is the candidate implementation for the linked compact Slack progress feature request.

Members:

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

Merge-risk options

Maintainer options:

  1. Accept the opt-in configuration contract (recommended)
    Approve after exact-head checks confirm omitted style remains card mode and existing fallback delivery behavior remains intact.
  2. Pause for product direction
    Keep the PR open if maintainers do not want to support another persistent Slack progress presentation mode.

Technical review

Best possible solution:

Accept compact as a Slack-only opt-in, retain card mode when the setting is absent, and preserve the existing safe final-delivery fallbacks.

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

Not applicable as a bug reproduction: this is an opt-in feature, and the contributor supplied a real Slack after-behavior trace for the requested flow.

Is this the best way to solve the issue?

Yes — the best implementation boundary is Slack-local suppression for compact mode while the shared compositor continues to render plans independently of tool-line visibility.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. A real Slack-app run shows one commentary message edited in place to the final response; the later exact-head change only moves plan suppression into the Slack runtime.

Label justifications:

  • P3: This is an opt-in Slack presentation enhancement rather than a broken message-delivery workflow.
  • merge-risk: 🚨 compatibility: The PR adds a documented persisted Slack configuration mode whose default and fallback behavior must remain stable for existing operators.
  • 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): A real Slack-app run shows one commentary message edited in place to the final response; the later exact-head change only moves plan suppression into the Slack runtime.
  • proof: sufficient: Contributor real behavior proof is sufficient. A real Slack-app run shows one commentary message edited in place to the final response; the later exact-head change only moves plan suppression into the Slack runtime.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Available current-main history identifies a recent touch to the Slack progress runtime; sparse history prevents a stronger ownership attribution. (role: recent current-main contributor; confidence: low; commits: 2f0f65e79060; files: extensions/slack/src/monitor/message-handler/dispatch-progress.ts)

Rank-up moves

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

  • Obtain maintainer acceptance of the new Slack configuration contract and let exact-head CI complete.

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-08-19T23:45:36.689Z sha faed382 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-20T20:44:26.439Z sha e87172c :: found issues before merge. :: [P3] Keep the progress-style read type-safe
  • reviewed 2026-08-20T21:05:13.961Z sha d6507a4 :: found issues before merge. :: [P3] Use a typed Slack progress-style reader
  • reviewed 2026-08-20T21:23:06.125Z sha fecacc8 :: found issues before merge. :: [P2] Keep plan suppression in the Slack compact runtime | [P3] Remove personal approval directives from source comments

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 20, 2026
@sjf-oa

sjf-oa commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Live Slack E2E proof

Ran on 2026-08-20 at 12:17 America/Los_Angeles against the original implementation commit faed3823e9ee16eaec30de7a5d095a7fad5a0f54, using a local gateway connected to a real Slack app.

Effective progress configuration:

{
  "mode": "progress",
  "nativeTransport": false,
  "progress": {
    "style": "compact",
    "label": false,
    "maxLines": 1,
    "commentary": true,
    "toolProgress": false
  }
}

The test prompt required a brief commentary update, three separate tool calls, and an exact final marker. External polling of Slack observed:

Local time Observable Slack state
12:17:44 One bot message containing only italic commentary: _I’ll inspect those three workspace facts with separate tool calls._
12:17:50 The exact same Slack message was edited to ECLAW_COMPACT_OBS_OK_20260820_1218.
After completion Conversation history contained exactly one bot response. No separate final message was posted.

This verifies the live behavior requested by the PR: commentary-only progress with no label/tool rows, followed by in-place replacement with the final answer.

The PR subsequently added stronger commentary-only suppression and regression coverage; its current head when this proof was attached is d6507a44dff91eee37b2320212adf1fe74416c15. The live run above records its exact tested SHA rather than claiming an exact-head rerun.

@sjf-oa sjf-oa self-assigned this Aug 20, 2026
@sjf-oa
sjf-oa force-pushed the sjf/slack-compact-commentary branch from fecacc8 to f22df38 Compare August 20, 2026 21:46
@sjf-oa

sjf-oa commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Review finding resolution

  • Fixed P2 by restoring the shared progress compositor contract: plans remain independent from toolProgress for every channel.
  • Slack now suppresses plan updates only inside its progress.style: "compact" runtime.
  • P3 is intentionally not applied. The product owner confirmed that the existing SJF/PASHPASHPASH approval comments are required and must remain.
  • Rebased cleanly onto main at 784a2287815c3de9802cfbed492ba071a22cca10; exact PR head is f22df38b953b646c6aa79bee6ce5a18e84532727.

Focused proof

The changed-file gate passed its core typechecks, formatter, guards, contract tests, dead-export scans, and boundary checks, then stopped at the unchanged repository error extensions/acpx/src/service.ts(114,9): error TS2353: Object literal may only specify known properties, and 'elicitationModes' does not exist in type 'OpenClawAcpxRuntimeOptions'. The exact-head hosted CI run passed.

The existing live Slack proof remains applicable because this follow-up changes only where plan suppression is owned; compact commentary and final edit-in-place behavior are unchanged: #126480 (comment)

@sjf-oa

sjf-oa commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review exact head f22df38b953b646c6aa79bee6ce5a18e84532727. P2 is fixed by restoring shared plan behavior and localizing compact plan suppression to Slack. P3 is intentionally skipped per product-owner requirement; the approval comments must remain.

@clawsweeper

clawsweeper Bot commented Aug 20, 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 the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 20, 2026
@sjf-oa
sjf-oa merged commit 67bcea1 into main Aug 20, 2026
399 of 402 checks passed
@sjf-oa
sjf-oa deleted the sjf/slack-compact-commentary branch August 20, 2026 22:02
@sjf-oa

sjf-oa commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 21, 2026
* feat(slack): add compact progress style

* chore(slack): protect compact progress contract

* chore(slack): clarify compact progress comment

* chore(slack): document compact task card behavior

* chore(slack): document compact draft card behavior

* chore(slack): document compact progress config contract

* fix(slack): enforce compact commentary-only progress

* chore(slack): strengthen compact style guard

* fix(slack): type compact progress config

* fix(slack): scope compact plan suppression

---------

Co-authored-by: Sarah Fortune <[email protected]>
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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.

[Feature]: Add compact Slack progress presentation

3 participants