Skip to content

fix(auto-reply): prevent false no-reply fallbacks - #115016

Merged
obviyus merged 11 commits into
openclaw:mainfrom
VACInc:agent/fix-reset-hook-fallback
Jul 29, 2026
Merged

obviyus merged 11 commits into
openclaw:mainfrom
VACInc:agent/fix-reset-hook-fallback

Conversation

@VACInc

@VACInc VACInc commented Jul 28, 2026 •

Copy link
Copy Markdown
Member

Summary

High Level TLDR

OpenClaw could send “No reply was generated...” even though the turn had already produced a valid outcome: a routed reset-hook acknowledgement, a routed/partial send without a conventional message ID, or work accepted by an already-active run.

Upstream PR #114799 added the shared turn-delivery ledger and fixed the general settlement race. This PR now builds on that ledger and closes the remaining concrete false-fallback paths without adding latency. The generic fallback remains available for genuinely empty, directed turns with definite non-delivery.

This consolidates the reset-route and accepted-busy-turn fixes in one PR.

Closes #115012.
Closes #115171.
Closes #115339.

What Problem This Solves

The generic failure fallback could be emitted after OpenClaw had already delivered, ambiguously sent, or accepted the user turn. This PR preserves those definitive handled outcomes while retaining the fallback for genuinely empty directed turns.

Root Cause

PR #114531 introduced a useful core fallback for directed visible turns that finish without a visible reply. Before #114799, fallback finalization primarily inferred visibility from dispatcher counts. #114799 replaced that inference with settled per-turn delivery accounting, but these sibling paths still sat outside or lost information at the route boundary.

Concrete before behavior

Routed reset-hook acknowledgement

  1. /new or /reset completed.
  2. A command hook sent its acknowledgement through routeReply.
  3. emitResetCommandHooks discarded the route result instead of reporting observed delivery.
  4. The turn ledger and dispatcher still appeared empty.
  5. Finalization emitted the generic fallback after the visible acknowledgement.

The first draft treated optional provider messageId as delivery proof. That was not sufficient: the outbound contract permits successful or unknown-after-send results without an editable ID.

Accepted active-run work

  1. A visible turn already owned the session reply lane.
  2. A second inbound message was successfully steered into that run or accepted into its follow-up queue.
  3. The second dispatch correctly returned no immediate reply payload.
  4. Finalization treated the empty immediate result as a model failure and emitted the generic fallback.

The message had been accepted; no model failure occurred in that second dispatch.

Lost route semantics

routeReply previously collapsed several distinct outcomes into ok plus an optional messageId:

  • hook-cancelled or hook-emptied delivery;
  • recipient-visible delivery with a provider sentinel or alternate identity;
  • partial failure after an earlier visible send;
  • adapter invocation that may have sent but returned no delivery identity.

Consumers could therefore retry, fall back, or register the wrong edit handle after a route that was already handled.

Sentinel ID leak in the route summary

The route summary correctly excluded skipped and suppressed results from delivered evidence, but when no visible result existed it fell back to the last raw result message ID. Slack delivery-hook suppression returns the control sentinel suppressed, so the summary exposed a non-delivery sentinel as an editable identity. The existing regression expectations explicitly encoded both leaked values, skipped and suppressed. The final head returns no message ID whenever delivery is false and corrects those expectations.

What changed

  • Add explicit route-level delivered evidence independent of optional message IDs.
  • Preserve intentional reasoning and message/reply hook suppression reasons.
  • Treat provider success sentinels and alternate identities as delivered but not editable IDs.
  • Preserve the last real editable message ID when a later batch result is a sentinel, no-ID receipt, or partial failure.
  • Treat adapter_returned_no_identity as ambiguous/handled so callers cannot duplicate an unknown-after-send route; no messageId is exposed.
  • Report successful reset-hook routing through the existing observed-delivery callback and turn ledger.
  • Record successful active-run steer/follow-up admission in the per-dispatch reply-operation state.
  • Exclude accepted active-run work from both the core fallback and channel-level fallback eligibility.
  • Keep adoption-loss silence intentional after transcript commit: the losing ingress dispatch neither replays the injected turn nor emits its own fallback.

Rejected, deduplicated, aborted, and queue-overflow admissions retain their existing behavior.

User impact

  • Bare /new and /reset produce only their intended acknowledgement.
  • Rapid consecutive messages do not receive a false model-failure notice merely because the newer message was accepted by the active run.
  • Routed partial or identity-less sends do not trigger duplicate fallback/retry.
  • Delivery-hook suppression remains non-delivery, preserving existing channel-level recovery eligibility.
  • Genuine empty completions and definite delivery failures retain the existing fallback.

Evidence

The exact base and then-current PR head were built in isolated checkouts and exercised through a real Telegram direct message on Proxmox Crabbox with the native Codex app-server runtime.

Real behavior proof

Exact-SHA Telegram and Codex before/after

Environment:

  • Base: b07efcb6dc7e84451b8421637f412df4de4a52ab.
  • Busy-turn proof candidate: 877031d21022511b9522b201310c9a39446154b5.
  • Real Telegram user and bot in a direct-message session; credentials and all account, chat, message, and session identifiers remained private.
  • Model: openai/gpt-5.6-sol with forced agentRuntime.id: codex; /status reported Runtime: OpenAI Codex on both lanes.
  • Queue mode: collect, matching the affected operator configuration. Telegram progress streaming was disabled so an editable progress draft could not hide the fallback under test.

Manual sequence on each exact SHA:

  1. Start a Codex turn that runs sleep 25.
  2. Confirm the sleep 25 process is active on the guest.
  3. While that tool call is active, send the second Telegram message that asks to execute the cheap NAS skill.
  4. Search the recipient-visible Telegram transcript for the generic model-failure fallback and wait for the owning turn to complete.

Observed before on the base SHA:

active tool wait observed: yes
accepted second message: yes
false generic fallback count: 1
fallback latency after second message: 2 seconds

Observed after on the PR head:

active tool wait observed: yes
accepted second message: yes
false generic fallback count: 0
fallback-free observation window: more than 146 seconds
owning turn completed normally: yes, 26 seconds after the second message

This proves the changed behavior at the real channel boundary: base misreported accepted busy work as a model failure, while the exact PR head kept the accepted dispatch silent and allowed the owning Codex turn to finish.

Live Telegram reset coverage

The earlier live reset observation remains valid for the sibling reset-hook path: a bare /new produced exactly one intended acknowledgement and no generic fallback during the observation window. The new Crabbox run above supplies the previously missing exact-head busy-turn proof.

Verification

Current live PR head: 7f8e7fa2fb1091e4a148958f45a61af23069ca9d.

The live before/after proof used base b07efcb6dc7e84451b8421637f412df4de4a52ab and busy-turn proof head 877031d21022511b9522b201310c9a39446154b5. Both exact source trees were installed and built independently on Crabbox. The final head adds only the focused sentinel-ID correction proved below.

Focused validation recorded for the branch:

Test Files  10 passed (10)
Tests       542 passed (542)

Test Files  1 passed (1)
Tests       1 passed | 119 skipped (120)

Commands:

node scripts/run-vitest.mjs run \
  src/auto-reply/reply/route-reply.test.ts \
  src/auto-reply/reply/route-reply.delivery-result.test.ts \
  src/auto-reply/reply/commands-reset-hooks.test.ts \
  src/auto-reply/reply/get-reply.reset-hooks-fallback.test.ts \
  src/auto-reply/reply/dispatch-acp.test.ts \
  src/auto-reply/reply/dispatch-acp-delivery.test.ts \
  src/auto-reply/reply/followup-delivery.test.ts \
  src/auto-reply/reply/dispatch-from-config.test.ts \
  src/auto-reply/reply/dispatch-from-config.turn-ledger.test.ts \
  src/auto-reply/reply/agent-runner-direct-runtime-config.test.ts

node scripts/run-vitest.mjs run \
  --config test/vitest/vitest.e2e.config.ts \
  src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts \
  -t "dispatches a declined steer once with its source-turn identity"
  • Core production TypeScript check: passed.
  • Targeted type-aware Oxlint over all 30 changed TypeScript files: passed.
  • Oxfmt over all changed TypeScript files: passed.
  • git diff --check: passed.
  • Gitleaks over the exact 10-commit range: no leaks.
  • Codex branch review: found the ambiguous unknown-after-send edge, which is fixed; exact content rerun clean with no accepted/actionable findings and autoreview correctness confidence 0.90.
  • Fable review via Claude CLI: exact-content follow-up clean; specifically verified no duplicate fallback/retry, no false edit handle, no masked definite failure/suppression, and no added latency.
  • ClawSweeper’s rebase concern is addressed: the branch was rebased repeatedly during review, its final patch was range-equivalent, and the live PR is mergeable.

Focused sentinel-ID leak regression

The final head was tested red/green at the route-result seam. With only the corrected expectations applied to the prior production code, the test failed and showed the leaked control values:

Test Files  1 failed (1)
Tests       2 failed | 11 passed (13)
received messageId "skipped" and "suppressed"

After applying the production fix:

Test Files  1 passed (1)
Tests       13 passed (13)

oxfmt --check passed for both changed files, git diff --check passed, and fresh Codex autoreview reported no accepted or actionable findings.

Performance

No network calls, storage reads, timers, retries, polling, model work, or additional waits were added. The new work is bounded in-memory state plus a reverse scan of already-produced send results. Accepted busy turns skip the turn-ledger settlement wait entirely.

What was not tested

  • The exact active-turn steer race from [Bug]: Successful active-turn steer emits false no-reply fallback #115339 was not reproduced deterministically; the exact-SHA real-channel proof used the related accepted follow-up path under the affected operator queue setting.
  • The final sentinel-ID-only commit was not rerun through Telegram; it changes route-result reporting after skipped or suppressed sends and was proved by the focused red/green route-level regression.
  • The queued cheap-NAS follow-up had not completed by the end of the bounded observation window; the owning Codex turn did complete normally, and no false fallback appeared.
  • No real third-party adapter returning adapter_returned_no_identity was available; the actual durable delivery seam is covered by the focused test.
  • The full agent-runner.runreplyagent.e2e.test.ts file has unrelated baseline/environment failures on current main; the changed steering case passes in isolation.
  • Queue items later removed by configured queue-overflow policy remain owned by queue policy; this PR does not redefine queue-drop UX.

AI Assistance

Codex traced and implemented the shared fallback fixes and ran the required branch review. ClawSweeper identified the stale-base and delivery-proof concerns. Fable independently reviewed the implementation through Claude CLI, including the adoption-loss and final ambiguous-send behavior.

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 28, 2026
@clawsweeper

clawsweeper Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 12:24 PM ET / 16:24 UTC.

ClawSweeper review

What this changes

This PR separates recipient-visible route delivery from editable message IDs, reports reset-hook delivery, and records accepted active-run admissions so the no-reply fallback does not duplicate valid outcomes.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 3 items remain

The patch has a coherent, bounded design and no discrete code defect is evident from the provided diff, but it still needs final-head real behavior proof before merge. The PR body confirms that the consolidated head was not redeployed and that the after-fix busy-turn sequence was not repeated. Likely related people: obviyus (high confidence) for the merged fallback and turn-ledger work this PR extends.

Priority: P2
Reviewed head: 5c488237168bd072beb88ac089ed2bd72a6cb51a

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation and focused coverage are substantial, but final-head real channel proof remains the material merge gate.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The body contains useful earlier-overlay reset evidence and a redacted pre-fix busy-turn recurrence, but explicitly lacks a final-head after-fix busy-turn run and final-head deployment; add redacted live transcript, terminal output, or Gateway logs before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The body contains useful earlier-overlay reset evidence and a redacted pre-fix busy-turn recurrence, but explicitly lacks a final-head after-fix busy-turn run and final-head deployment; add redacted live transcript, terminal output, or Gateway logs before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 4 items Current-main routing contract: Current main's route result models success, suppression, optional message identity, and error, but does not carry separate delivery evidence; the PR introduces that missing distinction at the routing boundary.
Finalization boundary: The PR adds the accepted-active-run fact to both core fallback and channel fallback-eligibility decisions, preserving the existing fallback for ordinary empty directed turns.
Merged feature provenance: The PR builds on the merged turn-ledger implementation from the prior fallback work; its author is the strongest history-based routing candidate for this shared delivery boundary.
Findings None None.
Security None None.

How this fits together

OpenClaw's auto-reply pipeline accepts an inbound channel turn, routes immediate replies or admits work to an active run, then uses delivery facts to decide whether a visible no-reply fallback is warranted. This PR changes the evidence reaching that final decision so a prior acknowledgement, an ambiguous send, or accepted deferred work is not mistaken for an empty model completion.

flowchart LR
  Inbound[Inbound channel turn] --> Dispatch[Auto-reply dispatch]
  Dispatch --> Route[Route immediate reply]
  Dispatch --> Active[Active-run steer or follow-up]
  Route --> Evidence[Delivery and suppression evidence]
  Active --> Evidence
  Evidence --> Finalize[Fallback eligibility decision]
  Finalize --> Output[Channel reply or intentional silence]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The body contains useful earlier-overlay reset evidence and a redacted pre-fix busy-turn recurrence, but explicitly lacks a final-head after-fix busy-turn run and final-head deployment; add redacted live transcript, terminal output, or Gateway logs before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P2) - delivered, suppression, and ambiguous-send classification now controls whether retries and no-reply fallbacks occur; without final-head live evidence, a legitimate empty completion could be silenced or a duplicate fallback could still surface on an uncovered channel path.
  • Resolve merge risk (P1) - The exact-head busy-turn scenario remains unproven in a real channel, even though the contributor provides focused tests and a pre-fix live recurrence.
Agent review details

Security

None.

PR surface

Source +174, Tests +453. Total +627 across 30 files.

View PR surface stats
Area Files Added Removed Net
Source 18 215 41 +174
Tests 12 477 24 +453
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 30 692 65 +627

Review metrics

None.

Mantis proof suggestion

Telegram Desktop can directly demonstrate the two user-visible claims that remain unproven on the final consolidated head. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify on the final head that a bare /new produces one acknowledgement without the generic fallback and that a second accepted busy turn produces no immediate fallback; return redacted transcript and Gateway evidence.

Merge-risk options

Maintainer options:

  1. Add final-head channel proof (recommended)
    Keep the PR open until a redacted exact-head Telegram or Gateway transcript demonstrates that reset-hook and accepted-busy paths avoid the generic fallback while genuine empty directed turns retain it.
  2. Pause the draft
    Leave the draft unmerged if reproducing the active-run behavior is not currently practical, rather than treating earlier-overlay evidence as proof of the consolidated head.

Technical review

Best possible solution:

Keep the routing and invocation-local admission design, then add redacted exact-head Telegram or Gateway evidence showing one reset acknowledgement without a fallback and a second message accepted by an active run without an immediate fallback.

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

No high-confidence current-head live reproduction is provided. The source path and a prior redacted Telegram recurrence identify the busy-turn mechanism, and the PR adds focused regression coverage, but the final consolidated head has not been exercised through that real channel flow.

Is this the best way to solve the issue?

Yes, conditionally: extending the existing turn ledger with route-level delivery evidence and a per-invocation accepted-admission state is narrower than adding retries, timing, or new global state. The solution still needs final-head real behavior proof before it is safe to merge.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 40fb1ca27e4e.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a concrete user-visible false-fallback repair with limited but meaningful message-delivery blast radius.
  • merge-risk: 🚨 message-delivery: The changed routing dispositions directly determine whether OpenClaw emits, suppresses, or retries a user-visible reply.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The body contains useful earlier-overlay reset evidence and a redacted pre-fix busy-turn recurrence, but explicitly lacks a final-head after-fix busy-turn run and final-head deployment; add redacted live transcript, terminal output, or Gateway logs before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The claimed improvement is directly visible in Telegram chat: reset acknowledgements and rapid follow-up turns should no longer receive a duplicate failure message.

Evidence

What I checked:

  • Current-main routing contract: Current main's route result models success, suppression, optional message identity, and error, but does not carry separate delivery evidence; the PR introduces that missing distinction at the routing boundary. (src/auto-reply/reply/route-reply.ts:141, 40fb1ca27e4e)
  • Finalization boundary: The PR adds the accepted-active-run fact to both core fallback and channel fallback-eligibility decisions, preserving the existing fallback for ordinary empty directed turns. (src/auto-reply/reply/dispatch-from-config.finalize.ts:284, 5c488237168b)
  • Merged feature provenance: The PR builds on the merged turn-ledger implementation from the prior fallback work; its author is the strongest history-based routing candidate for this shared delivery boundary. (src/auto-reply/reply/dispatch-from-config.turn-ledger.ts:1, 8eaa4d6d703e)
  • Proof gap acknowledged by contributor: The PR body explicitly states that the final consolidated head was not redeployed and that a fresh after-fix two-message Telegram busy-turn sequence was not repeated; prior live observations and focused tests are useful but do not prove the final head's complete user-visible behavior. (src/auto-reply/reply/agent-runner-run.ts:294, 5c488237168b)

Likely related people:

  • obviyus: Authored the merged core fallback and turn-ledger changes that define the delivery/fallback contract this PR extends. (role: merged feature author; confidence: high; commits: 885e690f3e6c, 8eaa4d6d703e; files: src/auto-reply/reply/route-reply.ts, src/auto-reply/reply/dispatch-from-config.finalize.ts, src/auto-reply/reply/dispatch-from-config.turn-ledger.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Capture a redacted exact-head Telegram or Gateway run for bare /new or /reset showing one acknowledgement and no generic fallback.
  • Capture a redacted exact-head two-message active-run sequence showing accepted follow-up or steering without an immediate fallback, then update the PR body for automatic re-review.

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 (6 earlier review cycles)
  • reviewed 2026-07-28T07:02:01.340Z sha 0568fce3648917251c71a37ace0d21569968d0db :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-28T07:18:05.015Z sha e203b91f06d709d81f51c478af20a89fd43ce1ad :: needs real behavior proof before merge. :: [P1] Observe successful routes that do not return a message ID
  • reviewed 2026-07-28T12:01:31.360Z sha fe9f8e5cb56f97edacac83e14ac47664062b7324 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-28T12:35:22.105Z sha 35fbfa69d42d174dc1f6cc5a76d9af435f364b32 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-28T15:19:37.918Z sha 23db5bcc0bcd70ea6a68472d17c0677a9690a638 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-28T16:11:10.133Z sha 5c488237168bd072beb88ac089ed2bd72a6cb51a :: needs real behavior proof before merge. :: none

@VACInc
VACInc force-pushed the agent/fix-reset-hook-fallback branch from 0568fce to e203b91 Compare July 28, 2026 07:12
@VACInc

VACInc commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

Rebased onto current main (c903ca8). New head: e203b91f06d. Focused reset/dispatch/routing validation rerun: 4 test files, 353 tests passed; git diff --check passed.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 28, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 28, 2026
@VACInc
VACInc force-pushed the agent/fix-reset-hook-fallback branch from fe9f8e5 to 35fbfa6 Compare July 28, 2026 12:30
@VACInc

VACInc commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

Rebased onto current main (89b6d85cdd8); new head 35fbfa69d42. The post-rebase branch review found one P1 in the expanded delivery contract: reasoning-only payloads could be retried through a fallback path. They are now explicitly suppressed, with a follow-up regression test. Refreshed validation: 8 files / 512 tests passed, targeted type-aware lint passed, core typecheck passed, and final branch review is clean (0 findings, confidence 0.90).

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@VACInc
VACInc force-pushed the agent/fix-reset-hook-fallback branch from 35fbfa6 to b3df235 Compare July 28, 2026 13:09
@VACInc VACInc changed the title fix(auto-reply): observe routed reset hook replies fix(auto-reply): prevent false no-reply fallbacks Jul 28, 2026
@VACInc

VACInc commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

Consolidated the accepted busy-turn fix from #115181 into this PR so both paths share one user-facing invariant and review lane. Rebased onto current main (8944331f286); new head: b3df23543e3.

Exact-head validation: 9 files / 526 focused tests passed; isolated steering E2E passed (1/120); targeted type-aware Oxlint, core TypeScript, diff check, and secret scan passed. Consolidated autoreview is clean with no actionable findings (0.88 confidence). It also found and this head fixes a partial-delivery message-ID selection issue.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@VACInc

VACInc commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@Patrick-Erichsen Patrick-Erichsen self-assigned this Jul 29, 2026
@obviyus

obviyus commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Maintainer verification — final-head live behavior proof (closes the ClawSweeper before-merge ask).

Environment: Linux (falc0n), source checkout of exact head 877031d21022511b9522b201310c9a39446154b5, ephemeral OPENCLAW_STATE_DIR, real gateway + telegram plugin against a localhost mock Bot API (apiRoot: http://127.0.0.1:18931, long-poll getUpdates, captured sendMessage) and a mock openai-completions provider (models.mode: merge, SSE). Scenario: Telegram DM sends "first question"; the first model call stalls 8s; "second question" arrives 2.5s later while the run is active. Baseline run: identical harness on current main (2ae5669a1477d982ebebdb124ae00bc430e737f3).

Before (main) — bug reproduced, including the fence side effect from #115171:

sendMessage: "No reply was generated for this message. This is usually a temporary model failure - please try again."
sendMessage: "REPLY TWO"

The accepted second turn drew the false fallback, and the fallback advanced the foreground freshness fence so run 1's real answer was dropped as stale — [turn/execution] visible channel turn dispatched with no queued reply payloads ... messageId=1001. The user never saw REPLY ONE.

After (this PR, exact head) — fixed:

sendMessage: "REPLY ONE"
sendMessage: "REPLY TWO"

Zero fallbacks. Gateway log shows the exact accepted-busy shape: update 9002 received while active=true, steer rejected (transcript_commit_wait_unsupported), message queued as follow-up, second dispatch completed with no queued reply payloads — and stayed silent; the follow-up executed and delivered after the owner cleared.

Also verified on the exact head:

  • Focused suites locally green: 600 tests across route-reply*, commands-reset-hooks, get-reply.reset-hooks-fallback, followup-delivery, dispatch-from-config*, dispatch-acp* (165 + 435).
  • Patch identity: the PR-side diff at 877031d2102 is byte-identical to reviewed head 5c488237168 (diff of merge-base...head patches is empty) — the last push was a pure rebase, so the prior Codex/Fable/ClawSweeper patch-quality reviews apply to the live head.
  • The reset-hook path ([Bug]: Reset hook acknowledgement triggers false model failure fallback #115012) is covered by the focused tests above plus the author's live overlay observation; every consumed disposition is an existing src/infra/outbound/deliver-types.ts contract.

Proceeding to land.

@obviyus
obviyus merged commit fb8e1aa into openclaw:main Jul 29, 2026
132 checks passed
@obviyus

obviyus commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Landed via squash onto main: fb8e1aa

  • Live before/after proof: see the verification comment above (busy-turn false fallback + swallowed first reply reproduced on main; zero fallbacks and both replies delivered on the PR head).
  • Scoped tests on the merged head content: node scripts/run-vitest.mjs src/auto-reply/reply/route-reply.test.ts src/auto-reply/reply/route-reply.delivery-result.test.ts src/auto-reply/reply/commands-reset-hooks.test.ts src/auto-reply/reply/followup-delivery.test.ts (116 passed) plus the wider dispatch set earlier (600 total). Required openclaw/ci-gate green on the exact merged SHA.
  • Changelog: release-owned in this repo; release generation will pick this up from the PR.

Thanks @VACInc!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
…epted turns (openclaw#115016)

* fix(auto-reply): observe routed reset hook replies
* fix(auto-reply): track settled route delivery
* fix(auto-reply): preserve reasoning route suppression
* fix(auto-reply): suppress fallback for accepted busy turns
* fix(auto-reply): preserve editable partial delivery ids
* test(auto-reply): align route delivery mock
* fix(auto-reply): preserve routed delivery semantics
* docs(auto-reply): clarify lost adoption ownership
* test(auto-reply): split routed delivery evidence cases
* fix(auto-reply): preserve ambiguous route sends
* fix(auto-reply): omit non-delivery sentinel ids

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

4 participants