Skip to content

fix(agents): preserve channel silent-reply guidance - #138345

Merged
steipete merged 8 commits into
openclaw:mainfrom
Eppiedude:fix/silent-reply-prompt-mode
Sep 6, 2026
Merged

steipete merged 8 commits into
openclaw:mainfrom
Eppiedude:fix/silent-reply-prompt-mode

Conversation

@Eppiedude

@Eppiedude Eppiedude commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Channel auto-replies could regain generic silent-reply instructions after the conversation context had already disabled them. The embedded attempt dropped the selected prompt mode, so the prompt builder restored its generic default. This contradicted the existing direct-chat reply contract, including Discord DMs.

Why This Change Was Made

Embedded attempts now preserve the prompt mode chosen by the conversation owner, matching the CLI path. The final diff also removes an unnecessary observer temporary without changing its attempt-local state. Production changes are +2/-2 lines.

The mocked-runner test and manually reconstructed prompt are replaced by a real isolated Gateway regression that captures the instructions sent to the provider and checks normal reply delivery. The documented prompt policy remains unchanged.

User Impact

Channel conversations retain their selected reply guidance throughout an embedded attempt. Direct auto-replies no longer receive the generic Silent Replies section when their conversation context already owns the reply contract. Generic callers and message-tool-only behavior remain unchanged.

Thanks @Eppiedude for identifying and fixing the missing forwarding field.

Evidence

  • Original baseline proof: the runner lost the selected mode, and an actual QA-channel direct message reached the provider with the unwanted Silent Replies section. Exactly one successful provider request and one correct visible reply were observed; Tooling and Safety guidance remained present.
  • Current-main composition proof: after resolving the dispatcher refactor against 96bf3652adabc25d86af15a950a72be63575acc5, the real Gateway flow passes with one successful provider request, one normal reply, no generic Silent Replies section, and Tooling/Safety intact. All 176 current renderer, CLI-prompt, tool-observer and error-state tests pass, as do the changed checks. Final production/test hashes and unchanged owner-source hashes were verified after all checks.
  • The proof uses a synthetic QA channel and mock provider through a real Gateway. It is not a live Discord session. The Discord producer and shared embedded/CLI prompt paths were inspected directly. The original baseline is historical root-cause evidence; the separate composition run proves the refactored current owner.
  • Earlier fixture iterations exposed a development-launcher rebuild loop and five test-lint errors. The regression uses the repository's existing prebuilt CLI fixture with canonical E2E build prerequisites, and the style errors were corrected. No timeout, assertion, or production check was weakened.
  • Fresh independent review and full autoreview found no actionable P0–P2 findings. The merge preserves the original contributor history and the current dispatcher structure.

Exact-head required CI passed on bdc1b8c3de153097f820d73fd2bd85d3a2dbadda in CI attempt 2. One dependency-install job was retried after a Matrix binary download connection reset; the retry and aggregate gate passed. No package changes were made. A separate read-only review of this published head also found no P0–P2 issues.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: qa-lab size: M labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 3:44 PM ET / 19:44 UTC.

ClawSweeper review

What this changes

Preserves channel-specific silent-reply guidance through embedded agent attempts, inlines the attempt-local tool observer, and adds Gateway coverage of provider instructions and reply delivery.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: current main still drops the conversation-selected prompt mode. The focused repair matches the documented contract, prior findings are resolved, and no actionable correctness issue remains.

Priority: P2
Reviewed head: bdc1b8c3de153097f820d73fd2bd85d3a2dbadda

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused owner-boundary repair with recorded before/after Gateway evidence, relevant regression coverage, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The captured composition evidence exercises direct QA-channel ingress through the real Gateway and repaired dispatcher to provider instructions, observing one normal reply with unwanted silence guidance absent and Tooling/Safety intact. This satisfies the repository's channel boundary-proof policy; linked artifacts could not be reopened in this environment.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The captured composition evidence exercises direct QA-channel ingress through the real Gateway and repaired dispatcher to provider instructions, observing one normal reply with unwanted silence guidance absent and Tooling/Safety intact. This satisfies the repository's channel boundary-proof policy; linked artifacts could not be reopened in this environment.
Evidence reviewed 8 items Verified introduced repair: The pinned base-to-head diff forwards silentReplyPromptMode and moves observer construction into the same attempt parameter object; it adds no configuration or authorization surface.
Current main still needs forwarding: Fetched main forwards sourceReplyDeliveryMode immediately followed by taskSuggestionDeliveryMode, omitting silentReplyPromptMode. No verified merged replacement was supplied or established. Release-tree inspection could not complete because the required historical blob was unavailable; no shipped-fix claim is made.
Existing conversation-owned contract: The conversation owner selects none when conversation context owns reply guidance. The embedded caller already forwards it into the outer run, and the CLI preparation path already preserves it.
Findings None None.
Security None None.

How this fits together

Channel conversations select reply guidance before launching an agent. The embedded dispatcher must carry that selection into the system prompt sent to the provider.

flowchart LR
  A[Channel message] --> B[Conversation reply policy]
  B --> C[Embedded attempt dispatcher]
  C --> D[System prompt builder]
  D --> E[Provider request]
  E --> F[Channel reply]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +198. Total +198 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 2 0
Tests 1 198 0 +198
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 200 2 +198

Review metrics

None.

Technical review

Best possible solution:

Keep conversation-owned reply guidance intact through every embedded attempt while retaining generic guidance for callers that select it.

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

Yes, from source: direct-channel context selects none, current main drops that field, and the renderer restores generic silence guidance. This review did not execute the reproduction.

Is this the best way to solve the issue?

Yes. Forwarding the existing field repairs the missing boundary without duplicating policy, and Gateway coverage detects the omission that renderer-only tests cannot.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a860f648b669.

Labels

Label justifications:

  • P2: Repairs a bounded prompt-propagation defect in channel replies without adding new product or configuration surface.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The captured composition evidence exercises direct QA-channel ingress through the real Gateway and repaired dispatcher to provider instructions, observing one normal reply with unwanted silence guidance absent and Tooling/Safety intact. This satisfies the repository's channel boundary-proof policy; linked artifacts could not be reopened in this environment.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured composition evidence exercises direct QA-channel ingress through the real Gateway and repaired dispatcher to provider instructions, observing one normal reply with unwanted silence guidance absent and Tooling/Safety intact. This satisfies the repository's channel boundary-proof policy; linked artifacts could not be reopened in this environment.

Evidence

What I checked:

  • Verified introduced repair: The pinned base-to-head diff forwards silentReplyPromptMode and moves observer construction into the same attempt parameter object; it adds no configuration or authorization surface. (src/agents/embedded-agent-runner/run/run-attempt-dispatch.ts:582, bdc1b8c3de15)
  • Current main still needs forwarding: Fetched main forwards sourceReplyDeliveryMode immediately followed by taskSuggestionDeliveryMode, omitting silentReplyPromptMode. No verified merged replacement was supplied or established. Release-tree inspection could not complete because the required historical blob was unavailable; no shipped-fix claim is made. (src/agents/embedded-agent-runner/run/run-attempt-dispatch.ts:582, a860f648b669)
  • Existing conversation-owned contract: The conversation owner selects none when conversation context owns reply guidance. The embedded caller already forwards it into the outer run, and the CLI preparation path already preserves it. (src/auto-reply/reply/get-reply-run-context.ts:272, bdc1b8c3de15)
  • Renderer behavior and documented expectation: The renderer defaults an omitted mode to generic and includes Silent Replies unless the mode is none. Existing renderer tests cover suppression, and the public system-prompt documentation defines the channel-specific behavior. (src/agents/system-prompt.ts:1066, bdc1b8c3de15)
  • Gateway regression and implementation boundary: The complete new test launches the existing prebuilt Gateway fixture, sends direct QA-channel ingress, captures provider instructions, and requires one successful request and one normal reply with Tooling/Safety retained and generic silence guidance absent. It explicitly selects the OpenClaw runtime; this proof does not depend on the Codex runtime contract. (test/e2e/qa-lab/runtime/silent-reply-prompt-mode.e2e.test.ts:116, bdc1b8c3de15)
  • Captured real-boundary proof: The supplied PR body records baseline failure at https://github.com/steipete/openclaw/actions/runs/34030276700 and repaired composition at https://github.com/steipete/openclaw/actions/runs/34051769923: one successful provider request, one visible reply, no generic Silent Replies section, and intact Tooling/Safety. It also reports 176 passing sibling tests. These are a real Gateway with a synthetic channel and mock provider, not live Discord. Attempts to reopen both run links failed in this review environment; assessment preserves the supplied evidence and prior sufficient classification without claiming independent artifact inspection or local execution.

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Marvinthebored: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-04T17:53:08.392Z sha 068aeb6 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-04T18:09:09.158Z sha 4ba56fd :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-04T18:41:27.066Z sha 1319260 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-04T23:05:45.892Z sha 1319260 :: needs changes before merge. :: [P2] [P2] Supply the required date in the prompt fixture
  • reviewed 2026-09-05T17:44:12.420Z sha 8b9fa50 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-05T18:50:34.614Z sha 48c2ae6 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-06T18:09:07.995Z sha 42fbec2 :: blocked before merge. :: none
  • reviewed 2026-09-06T19:08:50.468Z sha bdc1b8c :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot closed this Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 4, 2026
@Eppiedude
Eppiedude force-pushed the fix/silent-reply-prompt-mode branch from 85c4568 to 068aeb6 Compare September 4, 2026 17:43
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed docs Improvements or additions to documentation channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web scripts Repository scripts commands Command implementations extensions: qa-lab size: M labels Sep 4, 2026
@clawsweeper clawsweeper Bot added the proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. label Sep 4, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. labels Sep 4, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 5, 2026
@steipete steipete self-assigned this Sep 6, 2026
Preserve the conversation-owned prompt mode across embedded attempts and replace the mocked prompt reconstruction with actual Gateway/provider coverage.

Co-authored-by: Eppiedude <134296165+Eppiedude@users.noreply.github.com>
@steipete steipete changed the title fix: Discord DMs can receive silent-reply guidance unexpectedly fix(agents): preserve channel silent-reply guidance Sep 6, 2026
Resolve the dispatcher refactor while preserving the existing channel prompt-mode repair. The current composition passed the real Gateway flow, 176 sibling tests, and changed checks.
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 6, 2026
steipete added a commit that referenced this pull request Sep 6, 2026
Recognize the exact Codex machine address in the existing native squash-credit classifier. Reviewed bodies retain eligible contributor credit without reintroducing machine attribution; default and explicit machine-message refusal stays intact.

Validated six intended baseline failures followed by all 58 native attribution tests passing, exact retained #138345 preview composition, independent reviews, and required CI34057924168 on the prepared head.
@steipete
steipete merged commit a94e0b6 into openclaw:main Sep 6, 2026
376 of 379 checks passed
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
…ig-ref

* origin/main: (31 commits)
  docs(web): split the Control UI page into task pages (#140437)
  fix: tool_search rejects calls that send both query and queries (#140310)
  fix(update): preserve rollback and truthful serving reports (#140419)
  fix: restore context when CLI recovery starts a fresh session (#140294)
  refactor(tests): retain transport-driven auth dismissal coverage (#140430)
  fix: stop unfinished subagents before resetting a conversation (#140417)
  fix(models): cap configured output at the final context window (#140436)
  refactor(mcp): reuse transport config normalization (#140439)
  test(gateway): preserve saved config in auth reload fixture (#140433)
  fix(plugins): inherit active config for embedded agent runs (#140435)
  refactor(tui): remove test-only shutdown timer hooks (#140432)
  fix(agents): preserve channel silent-reply guidance (#138345)
  fix(tasks): cancel resumed yielded subagent tasks (#140410)
  refactor(doctor): share compaction config traversal (#140330)
  fix(doctor): restore LINE and Mattermost account promotion (#136045)
  docs: remove the empty release-sections nav group (#140427)
  fix(tooling): omit Codex machine squash credit (#140420)
  chore(ui): refresh control ui locales (#140384)
  refactor(plugin-sdk): reuse native approval input contracts (#140415)
  fix: silent model WebSocket streams hang past the idle timeout (#140335)
  ...

# Conflicts:
#	docs/web/control-ui.md
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Recognize the exact Codex machine address in the existing native squash-credit classifier. Reviewed bodies retain eligible contributor credit without reintroducing machine attribution; default and explicit machine-message refusal stays intact.

Validated six intended baseline failures followed by all 58 native attribution tests passing, exact retained openclaw#138345 preview composition, independent reviews, and required CI34057924168 on the prepared head.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Preserve conversation-specific silent-reply guidance across embedded attempts instead of restoring the generic default. Keep the current dispatcher ownership and one observer per attempt; production LOC is neutral.

Replace the mocked prompt reconstruction with a real isolated Gateway/provider regression. The current composition passes that flow, 176 sibling tests, changed checks, and exact-head CI. Proof uses a synthetic QA channel and mock provider; it is not live Discord evidence.

Co-authored-by: Eppiedude <134296165+Eppiedude@users.noreply.github.com>
Co-authored-by: OpenClaw Contributor <contributor@example.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants