Skip to content

Remove interrupted Slack progress messages when an agent decides not to reply - #125494

Merged
pash-openai merged 1 commit into
mainfrom
pash/slack-clean-up-silent-interrupted-progress
Aug 18, 2026
Merged

pash-openai merged 1 commit into
mainfrom
pash/slack-clean-up-silent-interrupted-progress

Conversation

@pash-openai

Copy link
Copy Markdown
Contributor

When someone replies while a Slack agent is working, OpenClaw correctly moves future output below the newer message. If the model then decides that no response is needed, however, the detached progress message remains visible and falsely suggests that the agent is still working. Clean up every unfinished detached preview when a turn ends silently, while preserving interrupted previews when the agent actually delivers a final reply.

@clawsweeper

clawsweeper Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: XS maintainer Maintainer-authored PR labels Aug 18, 2026
@pash-openai
pash-openai marked this pull request as ready for review August 18, 2026 01:31
@pash-openai
pash-openai enabled auto-merge (squash) August 18, 2026 01:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d2ee4d840e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// A person may have interrupted an ordinary preview before the model
// decided to stay silent. That preview is no longer the active draft, but
// leaving it behind falsely suggests the agent is still working.
await draftStream?.dropDetachedMessages();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Settle queued ordinary draft previews too

Clean up ordinary draft previews from onQueuedFollowupSettled, not only from this outer-dispatch closeout. A queued followup can run after this function has returned, emit a partial/block-mode tool or reasoning preview, be detached by a later human message, and then finish without delivering a reply. Since extensions/slack/src/monitor/message-handler/dispatch-progress.ts:642-648 leaves the settlement callback undefined outside progress-card mode, neither the active preview nor its detached predecessors are deleted, so Slack can still show an indefinite working message in the queued version of the scenario this change fixes.

AGENTS.md reference: AGENTS.md:L66-L66

Useful? React with 👍 / 👎.

Comment on lines +3865 to +3867
expect(draftStream.dropDetachedMessages).toHaveBeenCalledOnce();
expect(draftStream.dropDetachedMessages.mock.invocationCallOrder[0]).toBeGreaterThan(
draftStream.clear.mock.invocationCallOrder[0] ?? Number.POSITIVE_INFINITY,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add boundary proof for interrupted silent turns

Replace or supplement this mock-call assertion with a boundary test that composes real draft tracking, noteSlackDraftConversationMessage, silent dispatch closeout, and the resulting Slack delete. createDraftStreamStub makes dropDetachedMessages a no-op, so this test still passes if the real stream never records the interrupted preview or never deletes it; the separate draft-stream unit test does not exercise the dispatch-to-boundary integration changed here.

AGENTS.md reference: AGENTS.md:L295-L295

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant