Skip to content

Hook event: run:tool-start / run:tool-end for automated progress indicators #30285

Description

@sam-reed-ubind

Problem

There's no way to trigger automated actions when the LLM begins making tool calls during a run. This makes it impossible to build reliable progress indicators at the infrastructure level — you're forced to rely on the LLM choosing to call a progress script (prompt compliance), which is inherently unreliable.

Use case

Slack bots have no native typing indicator API. The ackReaction feature (plugin-level emoji on message receipt) solves the 'did it receive my message?' problem, but there's no equivalent for 'it's working on something with tools right now.'

We want to automatically post/edit a progress message in Slack when tool calls are happening, without any LLM involvement. Currently the only options are:

  1. Prompt the LLM to call a progress script (unreliable — prompt compliance fails ~30-50% of the time)
  2. Post a progress message on every inbound (too noisy — fires even for quick text-only replies)

Proposed events

  • *
    un:tool-start*
    — fires when the first tool call in a run begins executing. Context should include: sessionKey, channelId, conversationId, messageId (inbound), toolName, runId.
  • *
    un:tool-end*
    — fires when all tool calls in a turn complete (before the LLM produces its text response). Context should include: sessionKey, runId, toolCallCount, durationMs.
  • *
    un:complete*
    — fires when the entire run finishes (after reply delivery). Context should include: sessionKey, runId, hadToolCalls, replyDelivered (bool), totalDurationMs.

What this enables

A workspace hook could:

  1. On
    un:tool-start: post a progress indicator message to Slack (or add an emoji like ⚙️)
  2. On
    un:tool-end: update the progress message ('finishing up...')
  3. On
    un:complete: remove/edit the progress indicator

All without any LLM involvement — fully deterministic, zero token cost, 100% reliable.

Alternatives considered

  • ackReaction: already works great for receipt confirmation, but doesn't distinguish 'thinking about a text reply' from 'executing 5 tool calls over 30 seconds'
  • message:received hook + script: fires too early (before knowing if tools will be used)
  • message:sent hook: fires too late (after reply, not during tool execution)
  • Prompt instructions: fundamentally unreliable (7+ logged failures in our deployment, see Feature: message:received hook - event.messages.push() has no effect / need agent context injection #23430 for related context)

Environment

  • OpenClaw 2026.2.26
  • Slack channel (Socket Mode)
  • Windows gateway

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions