Repository navigation
Remove interrupted Slack progress messages when an agent decides not to reply - #125494
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
There was a problem hiding this comment.
💡 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(); |
There was a problem hiding this comment.
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 👍 / 👎.
| expect(draftStream.dropDetachedMessages).toHaveBeenCalledOnce(); | ||
| expect(draftStream.dropDetachedMessages.mock.invocationCallOrder[0]).toBeGreaterThan( | ||
| draftStream.clear.mock.invocationCallOrder[0] ?? Number.POSITIVE_INFINITY, |
There was a problem hiding this comment.
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 👍 / 👎.
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.