Skip to content

fix(auto-reply): restrict NO_REPLY to automatic group replies#82270

Merged
steipete merged 3 commits into
mainfrom
fix/webchat-direct-no-reply-prompt-82254
May 15, 2026
Merged

fix(auto-reply): restrict NO_REPLY to automatic group replies#82270
steipete merged 3 commits into
mainfrom
fix/webchat-direct-no-reply-prompt-82254

Conversation

@steipete

@steipete steipete commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary:

  • Restricts NO_REPLY prompt guidance to legacy automatic group/channel replies only; direct chats and message_tool_only source turns stay free of silent-token instructions.
  • Removes legacy silentReplyRewrite config/runtime fallback behavior, including dead pending-spawn rewrite plumbing, and adds doctor cleanup for old rewrite/direct silent-reply keys.
  • Suppresses accidental exact silent tokens during direct/routed delivery instead of rewriting them into visible fallback text; docs, changelog, generated config baseline, and delivery tests updated.

Verification:

  • pnpm docs:list
  • pnpm config:schema:gen && pnpm config:docs:gen
  • node --import tsx scripts/generate-config-doc-baseline.ts --check
  • node scripts/run-vitest.mjs src/infra/outbound/payloads.test.ts src/commands/doctor/shared/legacy-config-migrate.test.ts src/auto-reply/reply/groups.test.ts src/agents/prompt-composition.test.ts src/auto-reply/reply/route-reply.test.ts - 5 files, 109 tests passed
  • node scripts/run-vitest.mjs src/shared/silent-reply-policy.test.ts src/config/silent-reply.test.ts src/auto-reply/reply/groups.test.ts src/agents/prompt-composition.test.ts src/infra/outbound/payloads.test.ts src/infra/outbound/deliver.test.ts src/auto-reply/reply/reply-flow.test.ts src/auto-reply/reply/route-reply.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts src/commands/doctor/shared/legacy-config-migrate.test.ts extensions/telegram/src/bot/delivery.test.ts extensions/telegram/src/bot-message-dispatch.test.ts - 12 files, 366 tests passed
  • node scripts/run-vitest.mjs src/agents/prompt-composition.test.ts src/auto-reply/reply/route-reply.test.ts - 2 files, 32 tests passed
  • node scripts/run-vitest.mjs src/config/zod-schema.test.ts src/config/zod-schema.agent-defaults.test.ts src/config/schema.help.test.ts - 1 file found, 25 tests passed
  • pnpm tsgo:core --noEmit --pretty false
  • git diff --check
  • Prompt snapshot grep: no NO_REPLY, Silent Replies, respond with ONLY, or reply with exactly in direct/message-tool-only snapshots
  • codex-review --mode auto --full-access --output /tmp/codex-review-82254-cleanup-final.txt - clean, no accepted/actionable findings; review also ran 3 focused files, 77 tests, plus config docs baseline check
  • pnpm check:changed delegated to Testbox tbx_01krphwn6jkcdvp1wmqbnsj2x1; Blacksmith stayed queued for ~9m with no worker/IP/run URL, then the local waiter was stopped (exit -1), so no remote command executed

Behavior addressed: NO_REPLY is now only prompted for automatic group/channel replies where silence is allowed. Direct chats and message-tool-only source turns are quiet by not sending, not by asking the model to emit NO_REPLY.
Real environment tested: local repo unit/config/docs/type checks plus Codex review; Testbox changed gate was attempted as tbx_01krphwn6jkcdvp1wmqbnsj2x1 but stayed queued with no worker/IP/run URL and was stopped.
Exact steps or command run after this patch: focused Vitest files above, pnpm tsgo:core --noEmit --pretty false, config doc generation/check, prompt snapshot grep, git diff --check, pnpm docs:list, Codex review.
Evidence after fix: direct prompt invariant asserts no NO_REPLY; group automatic prompt still asserts exact NO_REPLY; message_tool_only prompt snapshots contain no NO_REPLY; dispatcher/outbound/Telegram route exact silent tokens to no delivery instead of rewrite text; generated config baseline no longer lists removed rewrite/direct keys.
Observed result after fix: direct and message-tool-only surfaces receive no silent-token system prompt; legacy group auto mode keeps the exact silent-token instruction; old silentReplyRewrite config is removed by doctor; dead rewrite-only pending-spawn hook is gone.
What was not tested: prompt snapshot generator/check hung before producing output and was killed; Testbox pnpm check:changed never got a worker and did not execute remotely; no live Telegram send was run for this refactor pass.

Fixes #82254

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels May 15, 2026
@clawsweeper

clawsweeper Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR removes direct/message-tool-only NO_REPLY prompt guidance, drops legacy silent-reply rewrite config/runtime paths, suppresses exact silent-token deliveries, and updates doctor migration, docs, generated config baselines, changelog, and tests.

Reproducibility: no. not as a live end-to-end reproduction in this read-only review. Source and v2026.5.12 inspection show the direct-chat path can receive exact NO_REPLY guidance while direct rewrite is enabled by default.

Real behavior proof
Override: A maintainer applied proof: override for this PR.

Next step before merge
Protected maintainer-labeled PR with a config-contract removal and merge-validation gaps; there is no narrow automated repair to queue from this review.

Security
Cleared: No concrete security or supply-chain concern was found in the diff.

Review details

Best possible solution:

Land this only after maintainers accept the config-contract removal and the PR head has appropriate changed-gate coverage, with the prompt/delivery fix kept scoped to preventing direct and message-tool-only silent-token leakage.

Do we have a high-confidence way to reproduce the issue?

No, not as a live end-to-end reproduction in this read-only review. Source and v2026.5.12 inspection show the direct-chat path can receive exact NO_REPLY guidance while direct rewrite is enabled by default.

Is this the best way to solve the issue?

Partly yes: removing direct/message-tool-only silent-token guidance and suppressing exact accidental tokens is the narrow code-path fix. The legacy config removal is broader and needs maintainer product/API acceptance before merge.

What I checked:

  • Protected PR labels: The provided live PR context lists maintainer, proof: override, channel: telegram, and mantis: telegram-visible-proof, so cleanup policy keeps the PR open for explicit maintainer handling while treating proof as overridden.
  • Current shipped behavior can inject direct-chat NO_REPLY guidance: v2026.5.12 has default direct silent-reply rewrite enabled and buildDirectChatContext can tell direct chats to reply exactly with NO_REPLY for fallback delivery. (src/auto-reply/reply/groups.ts:309, f066dd2f31c2)
  • Current main still has the source-level prompt path: Current main passes resolved silent policy and rewrite settings into buildDirectChatContext, whose direct-chat branch can emit exact silent-token instructions when rewrite is true. (src/auto-reply/reply/get-reply-run.ts:470, 0b7ff665f664)
  • PR head removes direct prompt and generic messaging token guidance: The PR diff removes silent-policy/rewrite inputs from direct prompt construction and passes silentReplyPromptMode through the Messaging section so direct/message-tool-only turns avoid NO_REPLY guidance. (src/agents/system-prompt.ts:1251, d430ebb23be5)
  • PR head suppresses exact silent-token delivery instead of rewriting: The PR diff removes the dispatcher rewrite/preserve branch and routes exact silent final payloads through normal normalization, which skips bare silent payloads before delivery. (src/auto-reply/reply/reply-dispatcher.ts:154, d430ebb23be5)
  • Config migration coverage is included but needs maintainer acceptance: The PR adds doctor migration rules for removed silentReplyRewrite and direct silent-reply keys, which addresses old configs but also changes the public config contract. (src/commands/doctor/shared/legacy-config-migrations.runtime.agents.ts:95, d430ebb23be5)

Likely related people:

  • steipete: Current-main blame for the direct-chat context, dispatcher rewrite, and outbound silent-reply planning points to Peter Steinberger, and nearby recent commits touched message delivery and channel history paths used by this PR. (role: recent area contributor; confidence: high; commits: 1ba75463a520, 4e6c85d930bd, a4b17d65a8ff; files: src/auto-reply/reply/groups.ts, src/auto-reply/reply/reply-dispatcher.ts, src/infra/outbound/payloads.ts)
  • Takhoffman: Earlier merged commits introduced and refined the silent-reply policy and prompt-alignment behavior that this PR changes. (role: feature-history owner; confidence: medium; commits: 1303b032412b, cc57d56b92f5; files: src/shared/silent-reply-policy.ts, src/config/silent-reply.ts, src/auto-reply/reply/groups.ts)

Remaining risk / open question:

  • The PR body says the Testbox changed gate never executed and no live Telegram send was run; proof: override bypasses the contributor proof gate but does not replace merge validation.
  • Removing silentReplyRewrite and direct silentReply config is a public config-contract change that should be explicitly accepted by maintainers before landing.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 0b7ff665f664.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 15, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram commands Command implementations size: L and removed size: XS labels May 15, 2026
@steipete steipete changed the title fix(auto-reply): avoid NO_REPLY prompt in direct chats fix(auto-reply): restrict NO_REPLY to automatic group replies May 15, 2026
@clawsweeper clawsweeper Bot added mantis: telegram-visible-proof Mantis should capture Telegram visible proof. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels May 15, 2026
@steipete
steipete force-pushed the fix/webchat-direct-no-reply-prompt-82254 branch from d5743af to d430ebb Compare May 15, 2026 20:19
@steipete steipete added the proof: override Maintainer override for the external PR real behavior proof gate. label May 15, 2026
@steipete
steipete merged commit 445ed9b into main May 15, 2026
88 of 94 checks passed
@steipete
steipete deleted the fix/webchat-direct-no-reply-prompt-82254 branch May 15, 2026 20:29
@steipete

Copy link
Copy Markdown
Contributor Author

Landed via rebase merge onto main.

  • Gate: rebased onto current origin/main; resolved CHANGELOG.md and generated config baseline conflicts; ran focused Vitest (5 files, 109 tests), node --import tsx scripts/generate-config-doc-baseline.ts --check, pnpm tsgo:core --noEmit --pretty false, and git diff --check on the rebased branch.
  • GitHub: Real behavior proof passed with maintainer proof: override; preflight/security/dependency/doc quick gates passed, broader matrix remained queued and non-blocking when GitHub accepted the merge.
  • Source head: d430ebb
  • Land commit: 445ed9b

Thanks @absol89 for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: telegram Channel integration: telegram commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. proof: override Maintainer override for the external PR real behavior proof gate. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Agent replies NO! or NO in the openclaw web UI after upgrading from 5.7 to 5.12 and using openclaw doctor

1 participant