Skip to content

[bug] setting reaction minimal trong channel advanced không còn ack ngay khi nhận request #183

Description

@mrgoonie

Context

Channel advanced setting reaction_level = "minimal" hình như đang bị sai timing.

Mục tiêu của minimal reaction là tạo tín hiệu rất nhẹ cho user biết: agent/hệ thống đã nhận request và đang xử lý, không cần spam nhiều reaction/status trung gian.

Hiện tại user chỉ thấy reaction 👍 sau khi agent đã trả lời xong, nên trong thời gian agent đang xử lý không có tín hiệu nào cho biết request đã được tiếp nhận.

Actual behavior

Khi channel advanced setting để reaction = minimal:

  1. User gửi message cho agent.
  2. Không thấy reaction ngay trên message của user.
  3. Agent xử lý một lúc.
  4. Agent gửi message trả lời xong.
  5. Lúc đó mới thấy reaction 👍 được thả.

Kết quả: user không biết agent đã nhận request chưa, hệ thống có đang chạy không, hay message bị miss/hang.

Expected behavior

Khi user gửi message và agent bắt đầu nhận/xử lý request:

  1. Agent/channel phải thả reaction ngay trên message của user, ví dụ 👍 hoặc reaction tương ứng trạng thái thinking/received.
  2. Reaction này xuất hiện trước hoặc gần như ngay khi run bắt đầu, không chờ tới lúc final response xong.
  3. Sau khi agent hoàn tất, minimal mode có thể:
    • giữ 👍 như acknowledgement, hoặc
    • chuyển sang done reaction nếu design hiện tại muốn terminal status,
    • nhưng không được chỉ thả reaction lần đầu sau final response.

Suspected area

Relevant code areas in current repo:

  • Telegram reactions:
    • internal/channels/telegram/reactions.go
    • comment around minimal mode currently says: “Minimal mode: only show terminal reactions (done/error), skip intermediate statuses.”
    • this likely explains the observed behavior: thinking/received is skipped, only done is shown.
  • Slack reactions:
    • internal/channels/slack/reactions.go
    • minimal mode comment says only show thinking and done, which sounds closer to expected behavior.
  • Event routing:
    • internal/channels/events.go
    • forwards agent lifecycle/tool status events to ReactionChannel.
  • Channel config factories/UI advanced settings:
    • Telegram/Slack/Feishu/etc. ReactionLevel config
    • web UI advanced channel setting for reaction level.

Why this is a bug

minimal should mean “minimal but useful”, not “silent until the answer is done”.

For long-running requests, no early reaction defeats the purpose of reactions as lightweight acknowledgement. The user needs immediate feedback that:

  • the message was received;
  • the agent run started;
  • the system is alive;
  • no duplicate resend is needed.

Reproduction steps

  1. Configure a Telegram channel with advanced setting reaction = minimal.
  2. Send a message that takes noticeable time to answer, e.g. a research/debug/code task.
  3. Observe the original user message during processing.
  4. Notice no immediate reaction appears.
  5. Wait for final agent reply.
  6. Observe 👍 appears only after the final reply.

Acceptance criteria

  • In minimal reaction mode, an acknowledgement reaction is added as soon as the user message is accepted / run starts.
  • The reaction should happen before final answer delivery, ideally near the first lifecycle status such as thinking, queued, received, or running.
  • Terminal done/error behavior remains sensible:
    • success can keep 👍 or transition to done reaction;
    • error should still surface an error reaction if supported.
  • Behavior is consistent across supported reaction channels where possible, especially Telegram and Slack.
  • Tests cover minimal reaction timing:
    • thinking/start status is not skipped in minimal mode;
    • done still works;
    • error still works;
    • off still disables reactions.
  • UI copy/tooltip for reaction setting should clarify behavior:
    • off: no reactions
    • minimal: immediate acknowledgement + terminal status only
    • full: richer intermediate statuses/tool reactions

Possible fix direction

For Telegram, update minimal filter so it allows the early acknowledgement status, not only done/error.

Current suspected behavior:

// minimal skips everything except done/error
if reactionLevel == "minimal" && status != "done" && status != "error" {
    return nil
}

Potential direction:

// minimal allows early acknowledgement plus terminal statuses
if reactionLevel == "minimal" && status != "thinking" && status != "running" && status != "done" && status != "error" {
    return nil
}

Exact status names should be checked against internal/channels/events.go and the existing reaction status map.

Open questions

  • Which status should be canonical for immediate acknowledgement: thinking, received, queued, or running?
  • Should minimal success keep 👍 from start to finish, or update to a different done emoji?
  • Should Telegram match Slack behavior, or should all channels share a common minimal reaction policy?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions