Repository navigation
fix: silence lowercase NO_REPLY and truncated heartbeat replies - #170972
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR recognizes NO_REPLY without case sensitivity and suppresses truncated tokens only in heartbeat contexts. Example: A heartbeat returns no_r with showOk enabled.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR provides owner-approved silence handling absent from current main, with no actionable code findings. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherAgent terminal preparation classifies model output once; delivery and history readers consume prepared text and visibility facts, while heartbeat normalization applies acknowledgment policy. flowchart TD
A[Model output] --> B[Terminal reply preparation]
B --> C[Prepared reply and disposition]
C --> D[Channel delivery]
C --> E[Transcript and history]
C --> F[Heartbeat normalization]
F --> D
Technical reviewBest possible solution: Retain the shared terminal classifier and explicit heartbeat context while preserving prepared visible replies and configured acknowledgments. Do we have a high-confidence way to reproduce the issue? Current-main source leaves lowercase no_reply visible and does not suppress no_r at heartbeat normalization; the body also reports Gateway reproductions, but this read-only review ran no target code. Is this the best way to solve the issue? The implementation uses the existing preparation owner, preserves leading-line precedence and recorded visibility, and confines fragment recognition to heartbeat contexts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a3ac586a6b91. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +34, Tests +110, Docs 0. Total +144 across 32 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (12 earlier review cycles; latest 8 shown)
Reviewed October 17, 2026, 2:53 AM ET / 06:53 UTC (Revision 13). |
d79e252 to
9a79aa2
Compare
|
@clawsweeper re-review All four Before-merge items are addressed on head 9a79aa2 (CI green):
|
|
🦞👀 Re-review progress:
|
…artbeat acks Small models (Gemini flash lite) occasionally truncate the silent token before the underscore and reply "no_r" from a heartbeat. Main already accepts truncations that keep the "NO_" prefix, so those were suppressed; the pre-underscore spelling fell through both gates and was delivered to the channel on every heartbeat interval. isHeartbeatAcknowledgementText now also recognizes a strict case-insensitive prefix of the silent token cut before the underscore, requiring at least 4 characters so ordinary words such as "No" stay substantive. The relaxation is heartbeat-scoped: normal replies and the full-token payload matcher are unchanged. Proof: new cases in heartbeat.test.ts cover NO_R/no_r/NO_RE/whitespace spellings as acks and No/No./NO/NO_REPLY-with-continuation as substantive. Red/green: without the change, the lowercase "no_r" and whitespace cases fail (ack not recognized) while everything else passes; with it, all 29 heartbeat tests pass. Heartbeat-filter, heartbeat-payload, heartbeat-tool-response, heartbeat-events-filter, and the cron isolated-agent suites pass (458 tests; one unrelated NO_PROXY preflight test fails identically on pristine main). oxfmt and oxlint are clean on the touched files. Fixes openclaw#170158.
…delivery boundary (openclaw#170158) normalizeHeartbeatDelivery still called the unchanged shared silent-payload matcher, so a successful heartbeat whose only visible reply was a truncated token such as no_r classified as delivery and was sent to the channel even though isHeartbeatAcknowledgementText recognized it as quiet. Recognize the truncated spelling at the delivery boundary in heartbeat mode (ordinary replies and message mode are unchanged) so final delivery and the acknowledgement consumers agree. Export the helper from heartbeat.ts and drop the duplicated negative test assertion. Proof: new delivery-boundary regression in heartbeat-reply-payload.test.ts fails on the base (no_r classified as delivery) and passes with the fix; alert payloads still deliver. 129 tests across the heartbeat, filter, and embedded-runner payload suites pass. oxfmt and oxlint clean.
9a79aa2 to
4665c12
Compare
|
@obviyus: this keeps the terminal-reply contract from #170534 and #171990: one classifier, leading control-line precedence, and the remaining answer stays visible even when it spells another token. The casing change applies to exact, leading, trailing, streaming, and stored-row recognition. Truncated prefixes remain heartbeat-only; @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
Related: #170158
What Problem This Solves
Fixes: lowercase or mixed-case
NO_REPLYtokens leak into replies, and truncated heartbeat tokens such asno_rare delivered as alerts.User Impact
NO_REPLYis case-insensitive: whole replies stay silent, one leading control line is removed, and a standalone trailing control line is removed while the answer is delivered. Inline, quoted, JSON, and punctuated mentions remain visible. Recorded visible replies are never reclassified.Only heartbeat-aware handling accepts strict truncated prefixes of at least four characters (
NO_R,no_r,No_Repl). Ordinary replies keep these fragments visible. ConfiguredshowOkacknowledgments, substantive alerts, andHEARTBEAT_OKcasing retain their existing behavior.Why This Change Was Made
Extends @Irish-Joseph's heartbeat repair on current main with the approved global casing behavior.
no_ralready contains the underscore; the original gap was casing, not an earlier truncation boundary.The existing terminal classifier remains the owner of final reply preparation and publishes its disposition. Main now shares its full-text preparation helper with stored history; the merge keeps that refactor and applies casing there. Shared acknowledgement readers require explicit heartbeat context before accepting a truncated prefix; ordinary history, cron output, queued events, and pending-delivery recovery preserve fragments. The existing leading-line helper is shared by terminal preparation, streaming, and stored-row handling; downstream delivery continues to consume prepared text and recorded facts. The earlier duplicate classifier-only regression has been removed; the heartbeat runner covers suppression and
showOk.This addresses token handling, not the separate cross-account routing allegation in the linked issue. No configuration, schema, or provider-prompt change is required.
Evidence
The regression reproduced on main through the actual Gateway: both a deterministic OpenAI-compatible provider and native Ollama
qwen3:4breturned rawno_replyas a visible optional reply. The new terminal regressions failed on unchanged production code (5 expected failures; 7.75s wall).After the fix, all nine real Gateway RPC cases passed on macOS. Native
qwen3:4bemitted raw lowercaseno_replyand produced no payload withdisposition: silent(23.048s). The deterministic cases covered lowercase/mixed-case silence, leading/trailing answer retention, literal suffix preservation, ordinaryno_r, inline text, and punctuation (54.453s combined RPC wall time including the model control).display: trueno_rdisappeared) and through six failing cron/event/pending tests before repair.pnpm build qaRuntimepassed on the casing implementation (22m 28.4s). After merging main, all 67 terminal/history tests passed in 305.51s, core types passed, and a fresh isolated Codex branch review was clean through P2 with explicit source context for unchanged indirect consumers.git diff --checkpassed.ClawSweeper reviewed exact head
212de6515cc367a4acbdb146f4844da4a47c1928with no findings; its remaining hold is only the live heartbeat/channel proof limitation below.The max-lines ratchet still reports existing suppressions in
ui/src/pages/chat/components/chat-message.test.tsx,ui/src/pages/config/config-page-state.ts, andui/src/pages/sessions/sessions-page-state.ts. This reproduces against the exact merged-main base86ad4c4ec0busing a temporary Git index; these files are unchanged by this PR. Mock-export safety passes after the main merge.The earlier CI run 38999252758 completed with 51 successful jobs and two failures outside this change;
openclaw/ci-gateis red. The automatic table labels both unknown because no matching jobs exist in its selected main run, so the attribution below is manual source evidence.chat-plugin-steering.e2e.test.tsstill waits for inner notices without opening the new collapsed system-event group introduced by main commitd5c7055a700(#173838); the test, grouping, and renderer are unchanged from the merged base.server.hooks-admission.test.tsfails during Gateway startup withSTATE_DATABASE_READ_ADMISSION_INVALIDATED, before model or reply handling; its startup, state-lifecycle, and fixture sources are unchanged from the merged base. Both files from that startup shard passed locally: 23 tests (737.58s wrapper wall, including preparation). This is a non-reproduction of the CI startup race, not a claimed fix; all relevant startup/state owners are byte-identical to the pinned base.The main merge includes
7d3a763f92e, which corrected the earlier directive-delivery fixture failure. Prior native-settlement fixture failures were recorded in an earlier CI run; the final run's extension test jobs passed.Recovery CI attribution after the main merge
CI run 39001336140, job
checks-node-changed-compact-large32-2, failed three assertions insubagent-parent-recovery.restart-integration.test.ts. The checkout log identifies its exact base asa5c62d0f47706ccf92ebc0913da4065a43b482ad; its PR head was00575802b12298b13add463b2c125ddad7dfd8f2.Only that test file was replayed on each SHA using the repository's pinned Bun on macOS, one worker,
--no-cache, and separate module-cache paths. Both runs had 3 failed / 18 passed, with identical test names, assertion messages, and missingrequesterSettleWakediff. PR-head wall time: 585.47s (445.17s Vitest); exact-base wall time: 610.69s (523.00s Vitest), including cold worker preparation and cleanup.This is inherited from main: the failing fixtures omit
operatorRecoverySource; registry restoration closes the unavailable completion authority and clearsrequesterSettleWakebefore the expected callback. Commit37d210e4aafadded the authority-restoration contract and updated the earlier warm-restart fixture, while these scenarios remain unseeded. The test, fixture, registry recovery, and completion-mutation owner blobs are identical between the two SHAs. No silence token reaches the failing wake-admission assertions. No classifier or test change was made for this follow-up.The preceding head merged main through
611806e42a47f7f57099b55abe668c17b0f4c912, including the plugin-steering UI test repair in7270ca0bc2586f40ae68f85eb45ddcf69efeb256(#175086). Head:b79806220efc22113c86484028750dd3f4594d11. The clean merge preserves the reviewed NO_REPLY change; its sole overlap is main exporting an existing text-block helper. CI run 39005294711 ran on that head. Both UI E2E shards passed. Its compact Node job failed with the same three recovery assertions and missing-wake diff reproduced on the exact base above; the new job log was fetched once and checked. The PostgreSQL attempts also reached the outer job timeout, as investigated below. This does not claim a green CI gate.PostgreSQL conformance attribution and refreshed main
Both cancelled attempts in run 39005294711 checked out merge
117ee908against exact based4623c19a35283421beddff7b04a38dbcd009cb7. Their first failure was the 300-second timeout inmatrix-roots.postgres.test.ts("ports every retained token/account root with the state family and restores fresh namespaces"); after 1523.26s and 1546.18s in the infrastructure project, the jobs timed out during the Doctor suite. Both attempt logs were fetched once.Only the affected Matrix file was replayed through the repository PostgreSQL conformance runner on the PR head and exact base, each against a fresh isolated PostgreSQL 17 cluster using the CI image, Node 24.22.0 on macOS arm64, one worker, and
--no-cache. Both produced 2 failed / 1 passed: the same primary 300-second timeout (PR 300217ms; base 300102ms), the same subsequent synthetic-config ENOENT assertion, and a passing rollback case. Total wrapper wall times were 856.28s PR / 609.26s base, including schema checks, worker preparation, and cleanup. Scheduled main run 39002992814 at737a0ac25447438a039295a6200ced99d6bc4a6dindependently has the same primary timeout (300053ms). This establishes the timeout as inherited; the secondary local error is not claimed identical to every CI attempt.No SQL, Kysely query, casing predicate, index, transaction, engine branch, or database traversal was changed by this PR. The stored-row changes classify already-loaded text in JavaScript. During both local stalls the persistent PostgreSQL connection was idle after the retained-agent INSERT, with no lock wait. The exact stalled worker operation remains unresolved; this does not establish Doctor as the cause. No classifier change or timeout increase was made to accommodate the failure.
The branch now merges main through
2044a2cab833b8c88d7c679c396cdfb51f455d13, including #175186 (abbfaa3a31d, recovery fixtures) and current PostgreSQL performance repairs. Head:212de6515cc367a4acbdb146f4844da4a47c1928. The merge is clean and does not alter the reviewed NO_REPLY patch. Fresh exact-head CI run 39011169552 passed, includingopenclaw/ci-gateand the previously failing compact recovery job. PostgreSQL conformance passed in 26m56s (06:48:06–07:15:02 UTC), compared with 17m22s for passing-main run 38995631641, job117287635042: 9m34s longer. The full job completed without a retry; no individual main change is claimed as the proven cause of the improvement.Production delta: +73/-39 (net +34); tests: +186/-76 (net +110); docs: +5/-5. The production increase is the strict prefix predicate and explicit context propagation through shared readers. This replaces the earlier public-session-only guards and prevents ordinary pending replies from being discarded. Existing helpers replace duplicated prefix branches. No model-facing prompt text changed.
Limitations: a running-Gateway heartbeat/channel round trip for truncated prefixes with
showOkoff/on was not run; the heartbeat-runner regression covers that policy. Live casing proof on the preceding head exercised Gateway preparation with synthetic sessions anddeliver: false, not a real Telegram send. All local proof ran on macOS. The isolated Gateway and fixture server were stopped cleanly; shared Ollama was left running.