feat: Slack Agents interaction surface (setStatus + Block Kit task cards) - #81
Open
digby-bw wants to merge 4 commits into
Open
feat: Slack Agents interaction surface (setStatus + Block Kit task cards)#81digby-bw wants to merge 4 commits into
digby-bw wants to merge 4 commits into
Conversation
added 2 commits
June 17, 2026 07:39
Covers: - Phase 1: assistant.threads.setStatus + completion notifications fix - Phase 2: Block Kit task cards for tool step visibility - Phase 3: suggested prompts + thread titles (needs assistant:write scope) Research: https://brainwavesio.slack.com/archives/C0AB3CQSSSZ/p1781659818854589
- All phases ship together (no phased rollout) - Never post fresh — always update in place - Full cut-over, no backward compat - Detailed Block Kit card spec, TaskCard class design - Testing checklist added
There was a problem hiding this comment.
2 issues found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/slack-agents-surface.md">
<violation number="1" location="docs/slack-agents-surface.md:267">
P2: Do not delete `emitProgress` yet; existing event handlers still depend on it for compaction/retry status updates.</violation>
<violation number="2" location="docs/slack-agents-surface.md:278">
P1: Use the nested `assistant_thread` fields for `setSuggestedPrompts`; the event does not expose `channel`/`threadTs` at the top level.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| Add handler for `assistant_thread_started` event (fires when a DM or Agent Container thread opens): | ||
| ```ts | ||
| client.onAssistantThreadStarted(async (event) => { | ||
| await client.setSuggestedPrompts(event.channel, event.threadTs, suggestedPrompts(event)); |
There was a problem hiding this comment.
P1: Use the nested assistant_thread fields for setSuggestedPrompts; the event does not expose channel/threadTs at the top level.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/slack-agents-surface.md, line 278:
<comment>Use the nested `assistant_thread` fields for `setSuggestedPrompts`; the event does not expose `channel`/`threadTs` at the top level.</comment>
<file context>
@@ -0,0 +1,322 @@
+Add handler for `assistant_thread_started` event (fires when a DM or Agent Container thread opens):
+```ts
+client.onAssistantThreadStarted(async (event) => {
+ await client.setSuggestedPrompts(event.channel, event.threadTs, suggestedPrompts(event));
+});
+```
</file context>
Suggested change
| await client.setSuggestedPrompts(event.channel, event.threadTs, suggestedPrompts(event)); | |
| await client.setSuggestedPrompts(event.assistant_thread.channel_id, event.assistant_thread.thread_ts, suggestedPrompts(event)); |
| } | ||
| ``` | ||
|
|
||
| Remove `emitProgress` from the interface (it was internal detail). |
There was a problem hiding this comment.
P2: Do not delete emitProgress yet; existing event handlers still depend on it for compaction/retry status updates.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/slack-agents-surface.md, line 267:
<comment>Do not delete `emitProgress` yet; existing event handlers still depend on it for compaction/retry status updates.</comment>
<file context>
@@ -0,0 +1,322 @@
+}
+```
+
+Remove `emitProgress` from the interface (it was internal detail).
+
+### `src/surface/linear.ts`
</file context>
…atus Implements the full Slack Agents surface spec from docs/slack-agents-surface.md: - SlackSurface now uses a TaskCard (Block Kit) that updates in place through the entire run lifecycle; never posts a second message - emitThinking: calls setStatus (DM/thread only), posts empty task card - emitToolStart/emitToolEnd: new methods replacing emitProgress; update card with per-step progress (in-progress → done/error with duration) - emitResponse: folds response text into card, collapses steps to summary line - resolve: final update with actual cost (streaming=false) - reject: updates card header with error text - Added setThreadStatus, setTitle, setSuggestedPrompts to SlackClient - Added onAssistantThreadStarted to SlackClient; router wires it to setSuggestedPrompts - setTitle called after first response in DM/thread contexts (main.ts callback) - MessageTransport and MessagePayload moved to surface/types.ts - AgentSurface: replaced emitProgress with emitToolStart/emitToolEnd - LinearSurface: emitToolStart/emitToolEnd are no-ops (interface compliance) - events.ts: compaction/retry events no longer surface to card (log only) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
3 issues found across 7 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/slack-agents-surface.md">
<violation number="1" location="docs/slack-agents-surface.md:267">
P2: Do not delete `emitProgress` yet; existing event handlers still depend on it for compaction/retry status updates.</violation>
<violation number="2" location="docs/slack-agents-surface.md:278">
P1: Use the nested `assistant_thread` fields for `setSuggestedPrompts`; the event does not expose `channel`/`threadTs` at the top level.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
…cope guard - Remove mdToMrkdwn() call inside TaskCard.toResolvedBlocks (caller already converts) - When response exceeds MAX_SECTION_TEXT, truncate card text with thread note and post full text via emitDetail - Silently swallow missing_scope errors from setSuggestedPrompts; warn on others Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Design and implementation of Slack's Agents interaction surface.
Design doc:
docs/slack-agents-surface.mdPhases
assistant.threads.setStatus— native loading indicator in thread header + completion notification fix (no scope changes needed)assistant:writescope + app reinstall)Status
Design doc committed. Implementation follows — ready for review/exploration by Claude/Codex.
Open questions (in doc)
Thread: https://brainwavesio.slack.com/archives/C0AB3CQSSSZ/p1781659818854589
Summary by cubic
Implements the full Slack Agents surface: native
assistant.threads.setStatusloading, a single Block Kit task card that updates in place, and suggested prompts/titles. Fixes long-response handling and scope errors for smoother UX.New Features
assistant.threads.setStatusonly when athread_tsexists; top-level channel posts skip it and go straight to the card.assistant_thread_started), and set thread titles after the first response (DM/thread only); requiresassistant:write.Bug Fixes
missing_scopeerrors from suggested prompts; warn on other failures.Written for commit 6579c38. Summary will update on new commits.