Skip to content

feat(core): busy_ack_skip_prefixes to silence queued-acks for automated actions - #1835

Open
MingChaoSun wants to merge 1 commit into
chenhg5:mainfrom
MingChaoSun:pr/busy-ack-prefix
Open

MingChaoSun wants to merge 1 commit into
chenhg5:mainfrom
MingChaoSun:pr/busy-ack-prefix

Conversation

@MingChaoSun

Copy link
Copy Markdown

Motivation

Messages arriving while the agent is busy get a "message queued" acknowledgment so the user knows they were received. That's the right default for humans typing — but for high-frequency automated card actions the ack is pure noise.

Concrete case from my deployment: multi-question survey cards whose buttons dispatch commands (each click already updates the card synchronously via the card callback, similar to what #1828 generalizes). A user answering 8 questions in quick succession while a turn is running gets 8 queued-ack chat messages they don't care about, and each one yanks the chat viewport to the bottom — actively harmful UX.

What this adds

An opt-in per-project list:

[[projects]]
busy_ack_skip_prefixes = ["【问卷】", "cmd:【问卷】"]
  • Messages whose content starts with any listed prefix are still queued and drained exactly as before — only the acknowledgment reply is suppressed.
  • Card buttons dispatch their command as cmd:<text>, so deployments using both paths list both prefixes (documented).
  • Empty/unset (default) acks every message — zero behavior change for existing configs.

Implementation

  • Engine.SetBusyAckSkipPrefixes + hasAnyPrefix helper guarding the single MsgMessageQueued reply in queueMessageForBusySession.
  • Wired from project config at both engine construction sites in cmd/cc-connect/main.go.
  • Config validation rejects empty entries.
  • Bilingual docs in config.example.toml next to agent_session_idle_timeout_mins.
  • Tests: prefix suppression (both forms), default acks-everything preserved, hasAnyPrefix edge cases. go test ./core/ ./config/ green.

中文说明

新增可选的项目级配置 busy_ack_skip_prefixes:agent 忙碌期间到达的消息若命中前缀(如高频问卷按钮派发的命令),照常入队和补发,只是不再回"已入队"回执——连点 8 题不再刷 8 条噪音回执、聊天窗口不再被拽底。默认不配置=每条都回执,零行为变化。

…ed actions

Messages arriving while the agent is busy normally get a "message queued"
acknowledgment. For high-frequency automated card actions (e.g. instant-
feedback survey buttons dispatched as cmd: commands) that ack is pure noise:
each click already updates the card synchronously, and the extra chat
message yanks the user's viewport to the latest entry.

This adds an opt-in per-project busy_ack_skip_prefixes list: messages whose
content starts with any listed prefix are still queued and drained as usual,
only the acknowledgment is suppressed. Card buttons dispatch as "cmd:<text>",
so deployments using both paths list both prefixes.

- Default (empty/unset) acks every message — zero behavior change.
- Config validation rejects empty entries; documented bilingually in
  config.example.toml.
- Tests: prefix suppression, default behavior preserved, hasAnyPrefix
  edge cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant