Skip to content

Commit 3e25e90

Browse files
committed
feat(slack): make the native agent card the default progress surface
Slack's native plan/task card was opt-in behind streaming.progress .nativeTaskCards while the Block Kit session card shipped as the default. The native surface is the better product on every axis we can measure -- one streamed message instead of three artifacts, live task rows with file paths and diff counts, and Slack's own agent chrome -- so it becomes the default and an explicit false selects the Block Kit card instead. The session link is now emitted only when it can actually work: the operator set gateway.publicOrigin and left the Control UI enabled. Installations with no externally reachable Gateway get no link rather than a dead one. The progress card still only appears for turns that do real work; the existing compositor start gate keeps plain question-and-answer turns card-free.
1 parent 93a7661 commit 3e25e90

6 files changed

Lines changed: 32 additions & 23 deletions

File tree

‎docs/channels/slack.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,9 +1518,11 @@ Hide raw command/exec text while keeping compact progress lines:
15181518

15191519
`channels.slack.streaming.nativeTransport` controls Slack native text streaming when `channels.slack.streaming.mode` is `partial` (default: `true`).
15201520

1521-
The default session card shows the current title, optional narration, plan checklist, recent activity, tool/file totals, and elapsed time. Completion changes the header to success or error while preserving the last plan and activity. When `gateway.publicOrigin` is configured, terminal cards include an **Open in OpenClaw** button linked to that session. If the Control UI is served below a path prefix, also set `gateway.controlUi.basePath`.
1521+
In `progress` mode, Slack's native agent card is the default: the whole turn is one streamed message that interleaves narration with a live plan/task card and finishes with the assistant's answer in that same message. The card appears only once a turn does real work — tool or plan activity still running after a short delay — so a plain question is answered without one.
15221522

1523-
Slack native progress task cards remain a separate opt-in path. Set `channels.slack.streaming.progress.nativeTaskCards` to `true` with `channels.slack.streaming.mode="progress"` to use Slack's native plan/task stream instead of the Block Kit session card. This setting is unchanged.
1523+
Set `channels.slack.streaming.progress.nativeTaskCards` to `false` to fall back to the Block Kit session card, which posts a separate message showing title, narration, plan checklist, recent activity, tool/file totals, and elapsed time, and finalizes to success or error.
1524+
1525+
Both surfaces link the session with **Open in OpenClaw**, but only when that link can work: `gateway.publicOrigin` must be set (the externally reachable Gateway origin) and the Control UI must not be disabled via `gateway.controlUi.enabled: false`. Installations that leave `publicOrigin` unset — where there is no way to reach OpenClaw from Slack — get no link rather than a dead one. If the Control UI is served below a path prefix, also set `gateway.controlUi.basePath`.
15241526

15251527
- A reply thread must be available for native text streaming and Slack assistant thread status to appear. Thread selection still follows `replyToMode`.
15261528
- Channel, group-chat, and top-level DM roots can still use the normal draft preview when native streaming is unavailable or no reply thread exists.

‎docs/concepts/streaming.md‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,14 @@ Slack-only:
270270
- `partial` can use Slack native streaming (`chat.startStream`/`append`/`stop`)
271271
when available.
272272
- `block` uses append-style draft previews.
273-
- `progress` maintains one live Block Kit session card, finalizes it to success
274-
or error, and always posts the assistant's final text as a separate message.
275-
- Terminal cards include **Open in OpenClaw** when `gateway.publicOrigin` is set.
276-
Slack's native plan/task stream remains opt-in through
277-
`streaming.progress.nativeTaskCards: true`.
273+
- `progress` streams Slack's native agent card by default: one message carries
274+
narration, the live plan/task card, and the final answer. The card appears
275+
only for turns that do real work, so plain questions are answered without one.
276+
`streaming.progress.nativeTaskCards: false` falls back to the Block Kit
277+
session card, which finalizes to success or error and posts the assistant's
278+
final text as a separate message.
279+
- Cards include **Open in OpenClaw** only when the session is actually openable:
280+
`gateway.publicOrigin` is set and `gateway.controlUi.enabled` is not `false`.
278281
- Top-level DMs without a reply thread use draft preview posts and edits
279282
instead of Slack native streaming.
280283
- Native and draft preview streaming suppress block replies for that turn, so a

‎extensions/slack/src/config-ui-hints.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const slackChannelConfigUiHints = {
3535
"preview.commandText":
3636
'Command/exec detail in preview tool-progress lines: "status" is the safe default; "raw" opts into command text.',
3737
"progress.nativeTaskCards":
38-
'Opt in to Slack native task-card progress updates when channels.slack.streaming.mode="progress" and streaming.nativeTransport is enabled. Default: false.',
38+
'Slack native task-card progress updates when channels.slack.streaming.mode="progress" and streaming.nativeTransport is enabled. Set false to fall back to the Block Kit progress card. Default: true.',
3939
},
4040
progress: { labels: "openclaw" },
4141
}),

‎extensions/slack/src/delivery-trace.test.ts‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -521,15 +521,12 @@ function createPreparedTraceMessage(scenario: SlackTraceScenarioName): PreparedS
521521
account: {
522522
accountId: "default",
523523
config: progressCard
524-
? {}
524+
? // Native task cards are the progress default; this scenario owns the
525+
// Block Kit opt-out path.
526+
{ streaming: { progress: { nativeTaskCards: false } } }
525527
: nativeProgress
526-
? {
527-
streaming: {
528-
mode: "progress",
529-
nativeTransport: true,
530-
progress: { nativeTaskCards: true },
531-
},
532-
}
528+
? // Empty progress config on purpose: proves the shipped default.
529+
{ streaming: { mode: "progress" } }
533530
: {
534531
streaming: {
535532
mode: "partial",

‎extensions/slack/src/monitor/message-handler/dispatch-helpers.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,20 @@ export function resolveExplicitSlackProgressTitle(
9797
return trimmed && trimmed.toLowerCase() !== "auto" ? trimmed : undefined;
9898
}
9999

100+
// Slack's native agent card is the default progress surface; operators opt out
101+
// with an explicit `false`, which falls back to the Block Kit progress card.
100102
export function resolveSlackNativeProgressTaskCards(
101103
entry: Parameters<typeof resolveChannelProgressDraftConfig>[0],
102104
): boolean {
103105
const streaming = entry?.streaming;
104106
if (!streaming || typeof streaming !== "object" || Array.isArray(streaming)) {
105-
return false;
107+
return true;
106108
}
107109
const progressConfig = (streaming as Record<string, unknown>).progress;
108-
return (
109-
Boolean(progressConfig) &&
110-
typeof progressConfig === "object" &&
111-
!Array.isArray(progressConfig) &&
112-
(progressConfig as { nativeTaskCards?: unknown }).nativeTaskCards === true
113-
);
110+
if (!progressConfig || typeof progressConfig !== "object" || Array.isArray(progressConfig)) {
111+
return true;
112+
}
113+
return (progressConfig as { nativeTaskCards?: unknown }).nativeTaskCards !== false;
114114
}
115115

116116
export function resolveSlackStreamingThreadHint(params: {

‎extensions/slack/src/monitor/message-handler/dispatch-progress-card.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ export function createSlackDraftProgressCardRuntime(params: {
3535
let finalStatus: Exclude<DraftProgressCardState, "working"> | undefined;
3636

3737
const resolveSessionUrl = () => {
38+
// Both conditions are the operator's own statement that this session is
39+
// openable: `publicOrigin` is where the Gateway is externally reachable,
40+
// and the Control UI is what serves the session route. Installations that
41+
// set neither, or that replaced the Control UI, get no dead link.
42+
if (cfg.gateway?.controlUi?.enabled === false) {
43+
return undefined;
44+
}
3845
const publicOrigin = resolveGatewayPublicOrigin(cfg);
3946
if (!publicOrigin) {
4047
return undefined;

0 commit comments

Comments
 (0)