Skip to content

fix(chat): busy-ack composes a natural line from the message and running tool (#1629) - #1630

Merged
Birfy merged 2 commits into
ThinkFlowLab:mainfrom
Birfy:fix/natural-busy-ack
Oct 29, 2026
Merged

Birfy merged 2 commits into
ThinkFlowLab:mainfrom
Birfy:fix/natural-busy-ack

Conversation

@Birfy

@Birfy Birfy commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Owner: Danyang Chen
Reviewer: Reviewer
Written-by: Grok Bot (box-local; no Cursor CloudAgent)
Labels: agent-pr

Fixes #1629

Related: #1586 (busy-ack, merged), #1628 (RunningStatus host, merged — this is rebased on it). #1509 (tool-wait interrupt) is separate, not this PR.

What changed

The busy-ack bubble no longer shows one canned sentence. core/src/host/busy-ack.js now composes the line deterministically from:

  • a clipped topic out of the user's message (first line; filler like 在吗/hi dropped),
  • the running tool from the live entry, in words (bash → 跑命令 / running a command, wait_job → 等一个任务跑完 / waiting on a job, …),
  • the message's language (CJK vs Latin), falling back to the UI language.

Three variants per shape (topic+tool, topic, tool, bare) × zh/en; the chat's previous ack text is never returned again. Coalescing (3 s) unchanged. Client fallback key (local queue/steer with no host ack yet) is a new line, not the old one.

Why templated, not a model call

The ack must appear immediately while the Bot's own turn is blocked; a model call would queue behind/alongside that turn, cost a call per message, add latency and need a template fallback anyway. A template is instant, free, offline-safe and testable. A cheap model rewrite can be layered later behind the same composeBusyAck if wanted.

Samples

  • 「帮我把周报的数据图再改一下」, tool bash → 看到你说「帮我把周报的数据图再改一下」了,我正在跑命令,弄完马上接上。
  • same, no tool → 「帮我把周报的数据图再改一下」记下了,马上接着处理。
  • "Can you also check the deploy logs?", tool wait_job → Noted "Can you also check the deploy logs" — still waiting on a job, then it’s next.
  • "hello", tool web_fetch → Seen — I’m reading a page, back to you shortly.
  • 「在吗」, no tool → 看到了,这步做完就回你。 / next: 新消息收到,稍等我一下。

Verification

  • Red first: new core/test/busy-ack.test.js against the old host → fails (no composer; canned text).
  • Tip: node --test test/busy-ack.test.js test/busy-ack-client.test.js → 10 pass / 0 fail.
  • npm --prefix core test → 1896 pass / 4 fail; the same 4 fail on origin/main on this box (at-menu, dsh-schedule ×2, DSH clock — env, unrelated).
  • lint OK, build-client --check OK, ds-bot-patches check OK, changelog check OK, arch-docs OK.

Residual

  • Tool-word map covers common names; unknown tools read "using ".
  • No LIVE/prod touched. No CloudAgent.

@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 29, 2026
@Birfy

Birfy commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at 69a9b2b
Written-by: Reviewer
Attestation: 69a9b2b role=Reviewer

Ran at this tip:

$ cd core && node --import ./test/harness-resolve.mjs --test test/busy-ack.test.js test/busy-ack-client.test.js test/client-bundle.test.js → all pass, 0 fail
$ # red first: new busy-ack.test.js against the pre-change host → fails (no composeBusyAck; canned 「收到,我先记着,手头忙完再详细回你。」)
$ node scripts/ds-bot-patches.mjs check → ok
$ node .github/scripts/changelog.mjs check → well formed
$ ARCH_DOCS_BASE=origin/main npm run arch-docs --prefix core → OK
$ gh pr checks 1630 → tests-ok pass, Node 24 · DSH 0.2.0-rc.2 pass, package pass, plugins (*) pass, merge-gate pass

Not run: LIVE/prod — out of scope.

Findings

No actionable findings. Host composes the ack deterministically (topic + running tool, message language, rotation, never the chat's previous line); never the old canned sentence; still instant, no model call. Coalesce/clear semantics unchanged.

@github-actions github-actions Bot added the pass label Oct 29, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 29, 2026
Merged via the queue into ThinkFlowLab:main with commit 118a1ea Oct 29, 2026
13 checks passed
@Birfy
Birfy deleted the fix/natural-busy-ack branch October 29, 2026 03:27
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Oct 29, 2026
HugoXK pushed a commit to HugoXK/FlyBot that referenced this pull request Oct 29, 2026
…til the host ack lands (ThinkFlowLab#1656) (ThinkFlowLab#1657)

Fixes ThinkFlowLab#1656

Written-by: Dev-1
Owner: Dev
Reviewer: Reviewer
Tip: ca01a97
Tree: d3c03c7

## What happens

ThinkFlowLab#1630 (merged at 69a9b2b) made the host compose a context-aware
busy-ack, but while that ack is still pending (only a local
`queued`/`steering` submission) the client drew the fixed `BUSY_ACK_KEY`
sentence 「看到了,这步做完就接着处理你这条。」, so users still saw a canned line first.

## What it does now

- `busy-ack-logic.js`: `BUSY_ACK_KEY` is removed; `busyAckText(hostAck)`
returns the host text (trimmed) or `''`, `busyAckPending(hostAck)` is
true until a host line exists; `busyAckVisible` treats a blank host text
as no ack.
- `BusyAckBubble`: with host text it draws that text in the bubble,
unchanged; while pending it draws the Bot's mark plus a three-dot
blinking indicator (`.bt-busy-dots`, `aria-busy`, `data-pending`,
reduced-motion respected) and no text. The host line replaces it when it
lands.
- The en/zh dictionary entry for the canned sentence is removed.
- Docs: `docs/subsystems/core-client.md` busy-ack paragraph updated.

## Generated artifacts

`core/client.js` from `npm --prefix core run build` (`build-client.mjs
--check` exit 0); `patches/ds-bot/0001`, `0003`, `0008` and the
`patches/ds-bot/files/...` mirrors from `node scripts/ds-bot-patches.mjs
generate`; `ds-bot-patches check`: 10 patches apply cleanly, core/
equals ds-bot/ + patches. No generated file hand-edited.

## Tests

`core/test/busy-ack-client.test.js` (4 tests): placement, visibility
incl. blank host text, pending → no text / host text shown, and the
canned zh/en sentence absent from `busy-ack.js`, `busy-ack-logic.js`,
`i18n.js` and the bundle `client.js`.

- `node --test test/busy-ack-client.test.js test/busy-ack.test.js
test/i18n.test.js` (core): 16/16 pass.
- `cd core && npm test`: 1924 tests, 1919 pass, 4 fail —
`at-menu.test.js`, `ThinkFlowLab#1320 dsh-schedule task type`, `recurring task
missed…`, `a loaded DSH clock…`; the same 4 fail on `origin/main` on
this box (environment), none touches busy-ack.

No screenshot: there is no local render harness for the core chat bubble
on this box.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Busy-ack bubble repeats one canned sentence (「收到,我先记着,手头忙完再详细回你。」)

1 participant