Repository navigation
fix(auto-reply): long punctuation runs stall abort-trigger detection - #184433
Conversation
Abort detection trims trailing punctuation with a regex that is retried from every character of a punctuation run that does not end the text. Channels run it on inbound text before the agent turn, and Slack runs it before sender checks, so a 40 KB message of `!` followed by one letter stalled the Gateway event loop for about 5 s and a 60 KB one for about 23 s through a Matrix room in a gateway run from source. A lookbehind now starts the match only at the first character of a punctuation run, which removes the same trailing run in one pass.
|
🦞👀 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 maintainer review before merge. What this changesPrevent abort-text detection from repeatedly rescanning long punctuation runs. Example: An ordinary punctuation-heavy non-command message reaches authenticated chat.send.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a demonstrated Gateway responsiveness bug with a focused, semantics-preserving change; no actionable defects found. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherInbound command routing, Gateway chat admission, and reply handling share an abort-text normalizer that converts message text into standalone Stop decisions. flowchart LR
A[Inbound message] --> B[Command normalization]
B --> C[Shared abort matcher]
C --> D[Ordinary turn admission]
C --> E[Authorized Stop operation]
Technical reviewBest possible solution: Land the focused shared-matcher repair after the existing current-head checks pass. Do we have a high-confidence way to reproduce the issue? Current-main source retains the repeated-rescan path, and supplied built-Gateway evidence reproduces the stall on pinned main; this read-only review ran no target code. Is this the best way to solve the issue? The patch removes repeated scanning at the existing shared owner without changing accepted punctuation, Stop phrases, authorization, or authored text. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1a2eb9f0da9f. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +6. Total +6 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel 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 HistoryReviewed October 31, 2026, 6:37 PM ET / 22:37 UTC (Revision 3). |
|
Added the requested raw Gateway output to the PR body (Evidence, "Real Gateway, per-message timing"), on the unchanged head I ran the Matrix Gateway harness again on this branch and on its merge base On the failed @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@steipete could you rerun the failed The 3 failures are all in
This PR only changes the trailing-punctuation regex in |
Responsiveness proof ruleBefore the new built-artifact replay: use a secretless isolated Gateway and the ordinary Acceptance: reproduce a multi-second responsiveness stall on main and remove that stall on the candidate (target: each measured candidate round below one second). Normal standalone abort words must still stop an active held turn, and ordinary user text must remain unchanged at the local provider boundary. Report individual samples and controls, not a general throughput or percentile claim. The exact stress input and its generator remain private; only its shape and measured latency will be published. Current main is being merged as requested before candidate proof. The contributor's older SQLite CI failure is prior-head evidence, not a reason to skip reproduction or a claim that the new head is green. |
Built Gateway responsiveness proofExact candidate Pre-run measurement rule. Official Node 24.22.1, secretless Docker, real built Gateway, ordinary authenticated The stress input is a long punctuation-heavy non-command message with a non-punctuation terminator. Its exact contents, size and generator are intentionally not published. No runtime preload, mocked Gateway, admission bypass or message-size policy change.
Subsequent health calls returned in 0.6–1.2 ms on both refs. Initial warm health samples were approximately 23–26 ms, followed by approximately 1 ms cached calls. Candidate meets the prewritten below-one-second criterion in both rounds. These are individual warm, serial, CPU-profiled samples—not a general throughput or percentile claim. Causal signal: the Gateway main-thread CPU profile attributes approximately 18,084.7 ms to the shared abort normalizer family on main, versus 4.8 ms on the candidate. Main's trailing matcher accounts for 76.6% of sampled on-CPU time. The sampled stacks include ordinary chat admission and downstream reply abort checks in built Controls, twice per ref: an ordinary message reaches native history and the provider with its authored text unchanged. A normal standalone punctuated Stop word stops an active held turn: the response identifies that exact run, and its provider stream closes. Stress messages remain ordinary admitted turns and complete successfully. Both Gateways shut down cleanly. No channel-specific or unauthenticated-input claim. Matching equivalence: 111,811 bounded short inputs produce identical normalization and standalone-abort decisions on main and candidate. All 28 existing abort-owner tests pass on the candidate. The consolidated regression fails on main at 1,690.0 ms versus its 500 ms bound and passes with the fix. Build, targeted lint, formatting and whitespace checks pass. The standalone duplicate test file was removed; its long-run positive/negative timing guard now lives in the existing admission-semantics case, replacing redundant casing examples while keeping multilingual, targeted-command and authorization coverage. Test-line delta 0; production +6, two files. Matching characters, outputs and admission policy are unchanged. Current-head CI and review are requested separately; the contributor's earlier SQLite conflict is not being presented as current-head evidence. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 0a171b4. Thanks @LeizhenZhang. Long messages no longer stall the Gateway during the abort-word check. |
…(#184433) fix(chat): keep the Gateway responsive while checking long messages for abort words The shared normalizer that strips punctuation before checking for abort words such as "stop" used a regular expression that backtracked heavily on some long inbound messages. One `chat.send` could block the Gateway's event loop for about three seconds. The normalizer now uses a linear scan with the same results. Abort words still abort the run, and ordinary messages are unchanged. Evidence: built Gateway with ordinary `chat.send`. Main's peak health RPC delay was 3,037 ms and 3,065 ms; with this change it was 19.9 ms and 11.0 ms. CPU profiles attribute the stall to the shared abort normalizer. Normal stop words still aborted the held run and closed its provider stream, and ordinary text was unchanged, twice per ref. 111,811 old-versus-new comparisons showed no differences. Details: openclaw/openclaw#184433 (comment). Thanks @LeizhenZhang. Co-authored-by: Ayaan Zaidi <[email protected]>
…penclaw#184433) fix(chat): keep the Gateway responsive while checking long messages for abort words The shared normalizer that strips punctuation before checking for abort words such as "stop" used a regular expression that backtracked heavily on some long inbound messages. One `chat.send` could block the Gateway's event loop for about three seconds. The normalizer now uses a linear scan with the same results. Abort words still abort the run, and ordinary messages are unchanged. Evidence: built Gateway with ordinary `chat.send`. Main's peak health RPC delay was 3,037 ms and 3,065 ms; with this change it was 19.9 ms and 11.0 ms. CPU profiles attribute the stall to the shared abort normalizer. Normal stop words still aborted the held run and closed its provider stream, and ordinary text was unchanged, twice per ref. 111,811 old-versus-new comparisons showed no differences. Details: openclaw#184433 (comment). Thanks @LeizhenZhang. Co-authored-by: Ayaan Zaidi <[email protected]>
Adapt approved source fixes to the September extended-stable owners. Preserve original APIs and custody; include review-driven regressions. Backport-of: 0a171b4 — Leizhen Zhang — fix(auto-reply): long punctuation runs stall abort-trigger detection (#184433) Backport-of: 49600b5 — Long Jin — fix(memory): preserve inline notes during MEMORY.md compaction (#164089) Backport-of: 982f3b1 — RoboClaw — fix(imessage): report Automation failures after Gateway updates (#186117) Backport-of: 3f7ee38 — art22s — fix: require approval for dynamic shell predicates (#187884) Validation: independent source review, exact patch/file identity and git diff --check. Runtime tests, types and builds deferred to authorized remote CI; not run locally. Co-authored-by: RomneyDa <[email protected]>
* fix(gateway): publish node reapproval with committed pairing facts Adapt main commit 94f180d to the extended-stable worker dispatcher, retaining cleanup admission and stale-session fencing. Co-authored-by: RomneyDa <[email protected]> * test(gateway): clarify CLI announcement tool-only phase Keep exact token, barrier, and completion ordering assertions intact while explicitly excluding narration before the barrier. Co-authored-by: RomneyDa <[email protected]> * style(gateway): format node reapproval regression Reflow the spy chain reported by hosted CI; no behavioral changes. Co-authored-by: RomneyDa <[email protected]> * test(secrets): decouple Telegram fixture from plugin discovery Import the real public Telegram secret collector directly so collection does not depend on Gateway discovery environment. Exercise collection with bundled plugins disabled while retaining existing token assertions. Gateway timeout attribution remains unresolved; no production behavior or timeout changes. Co-authored-by: RomneyDa <[email protected]> * test(secrets): load Telegram fixture through public resolver Replace the static extension import rejected by core type and boundary checks with the existing test public-artifact resolver. Keep the real collector in the Vitest module graph and preserve the disabled-discovery regression. Independent source review accepted; local test, typecheck, build, install, and performance execution remain excluded by operator instruction. Hosted CI must validate the correction. Co-authored-by: RomneyDa <[email protected]> * style(secrets): format Telegram fixture import Co-authored-by: RomneyDa <[email protected]> * fix(ui): honor recovery holds before initial chat history Keep drafting available while the existing send owner holds recovery or a retained initial turn. Restore Send when that hold clears without waiting for initial history or submitting the draft automatically. Add renderer regressions for both holds and clarify the pre-history outbox contract. Controlled real-Gateway red/green evidence: 42523861169 / 42526889715. Diagnostic branch is not merged. Co-authored-by: RomneyDa <[email protected]> * fix(ui): preserve startup status presentation while holding send Restore the existing connected startup/history status suppression without reopening Send admission. Extend both durable hold regressions to reject the duplicate composer status band. Existing cloud E2E assertions remain unchanged. Co-authored-by: RomneyDa <[email protected]> * fix(release): backport installer, service, path and telemetry repairs Adapt approved source fixes to the September extended-stable owners. Preserve original APIs and custody; include review-driven regressions. Backport-of: eb5d0cb — Javier MV — fix(install): keep the installed runtime private under umask 0002 (#186782) Backport-of: b079019 — Sukhdeep — fix(daemon): Gateway repair stops the Gateway and fails when macOS denies the Trash (#189321) Backport-of: 558e2f3 — YangManBOBO — fix(cli): compare gateway state dirs case-insensitively on Windows (#185917) Backport-of: b7ce1c3 — Peter Steinberger — test(windows): keep ordinary CLI coverage in one partition Backport-of: ba75cf7 — Juan Buhagiar Duijst — fix(diagnostics-otel): gateway stalls after model calls on large sessions with content capture on (#186666) Validation: independent source review, exact patch/file identity and git diff --check. Runtime tests, types and builds deferred to authorized remote CI; not run locally. Co-authored-by: RomneyDa <[email protected]> * fix(release): preserve notes and harden messaging and exec approval Adapt approved source fixes to the September extended-stable owners. Preserve original APIs and custody; include review-driven regressions. Backport-of: 0a171b4 — Leizhen Zhang — fix(auto-reply): long punctuation runs stall abort-trigger detection (#184433) Backport-of: 49600b5 — Long Jin — fix(memory): preserve inline notes during MEMORY.md compaction (#164089) Backport-of: 982f3b1 — RoboClaw — fix(imessage): report Automation failures after Gateway updates (#186117) Backport-of: 3f7ee38 — art22s — fix: require approval for dynamic shell predicates (#187884) Validation: independent source review, exact patch/file identity and git diff --check. Runtime tests, types and builds deferred to authorized remote CI; not run locally. Co-authored-by: RomneyDa <[email protected]> * fix(release): retain sandbox, recovery lease and Matrix boundaries Adapt approved source fixes to the September extended-stable owners. Preserve original APIs and custody; include review-driven regressions. Backport-of: a19f1bf — Agustin Rivera — fix(agents): fail closed when sandboxed spawned children resolve CLI-backed models (#178742) Backport-of: c9f3f82 — Peter Steinberger — fix(agents): release restart-recovery fences for killed runs (#181992) Backport-of: dfb6454 — Leizhen Zhang — fix(matrix): crafted formatted_body stalls the Gateway in the mention check (#184432) Validation: independent source review, exact patch/file identity and git diff --check. Runtime tests, types and builds deferred to authorized remote CI; not run locally. Co-authored-by: RomneyDa <[email protected]> * fix(config): preserve last-good state through writes and rollback Adapt approved source fixes to the September extended-stable owners. Preserve original APIs and custody; include review-driven regressions. Backport-of: 99418fc — weiqinl — fix(config): keep last-known-good when the observer flags the config as truncated (#152565) Validation: independent source review, exact patch/file identity and git diff --check. Runtime tests, types and builds deferred to authorized remote CI; not run locally. Co-authored-by: RomneyDa <[email protected]> * fix(sessions): preserve history when relocating relative stores Adapt approved source fixes to the September extended-stable owners. Preserve original APIs and custody; include review-driven regressions. Backport-of: a64daf7 — Peter Steinberger — fix(sessions): resolve relative session stores against the state dir, not the working directory (#182444) Validation: independent source review, exact patch/file identity and git diff --check. Runtime tests, types and builds deferred to authorized remote CI; not run locally. Co-authored-by: RomneyDa <[email protected]> * fix(release): repair September backport type contracts Split terminal recovery actions into distinct discriminants without changing behavior. Use the branch-native Doctor import signature, checking held maintenance authority before and after the awaited import. Validation: independent exact-diff source review, formatter and git diff --check passed. Local tests, typechecks and builds not run per operator restriction; fresh exact-head remote qualification required. Repairs CI 42643973970 attempt 1. Co-authored-by: RomneyDa <[email protected]> * fix(release): align backport regressions with September contracts Preserve uncertain config-write outcomes while correcting branch-native fixture APIs and lint errors found by hosted CI. Co-authored-by: RomneyDa <[email protected]> * test(ci): separate Windows capacity from growing inventory Keep package coverage and the five-job limit independent of a historical timing snapshot. Preserve the rounded capacity boundary and exercise the documented bounded-growth fallback with fixed estimates. Co-authored-by: RomneyDa <[email protected]> * test(node-host): keep launcher cleanup with its invoke owner Wait for a positive launcher PID before probing liveness, and cancel through the existing invocation owner on every exit path. Never send SIGKILL to file-derived PID zero. Co-authored-by: RomneyDa <[email protected]> * test(release): observe owned Gateway reservation cleanup Verify the real reservation closes before relaunch instead of rebinding an already-released port that another socket can acquire. Preserve all seven packaged startup recovery scenarios. Co-authored-by: RomneyDa <[email protected]> * test(release): capture native compiler busy-executable evidence Preserve real API execution and errors while recording failure-only executable inode and writable descriptor metadata. Add a Linux kernel-path diagnostic regression; no retry or copy change. Co-authored-by: RomneyDa <[email protected]> * test(release): repair stability regression fixtures Register CLI admission metadata through the runtime registry, observe the rollback health baseline, and preserve exact SQLite byte expectations. Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: RomneyDa <[email protected]>
…penclaw#184433) fix(chat): keep the Gateway responsive while checking long messages for abort words The shared normalizer that strips punctuation before checking for abort words such as "stop" used a regular expression that backtracked heavily on some long inbound messages. One `chat.send` could block the Gateway's event loop for about three seconds. The normalizer now uses a linear scan with the same results. Abort words still abort the run, and ordinary messages are unchanged. Evidence: built Gateway with ordinary `chat.send`. Main's peak health RPC delay was 3,037 ms and 3,065 ms; with this change it was 19.9 ms and 11.0 ms. CPU profiles attribute the stall to the shared abort normalizer. Normal stop words still aborted the held run and closed its provider stream, and ordinary text was unchanged, twice per ref. 111,811 old-versus-new comparisons showed no differences. Details: openclaw#184433 (comment). Thanks @LeizhenZhang. Co-authored-by: Ayaan Zaidi <[email protected]> Release adaptation: Extend existing abort-entrypoint regression. Baseline RED; 15 GREEN (48.36s wrapper). Exact production patch retained. Independent P0-P2 source and boundary review found no actionable findings. Targeted typed lint: zero warnings/errors; formatting and diff checks pass. Integrated release push gate and stable FRV remain required. (cherry picked from commit 0a171b4) Co-authored-by: RomneyDa <[email protected]>
Backport #184433 to the signed v2026.11.5 baseline. Preserve shared abort-trigger semantics while restricting trailing matches to run starts. Co-authored-by: Ayaan Zaidi <[email protected]> Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Certain ordinary inbound text makes the shared abort-punctuation matcher repeatedly rescan the same run, blocking the Gateway main thread. The message need not be an abort command.
User Impact
The Gateway stays responsive while checking punctuation-heavy text. Existing abort words still abort, and ordinary message text is unchanged.
Why This Change Was Made
Allow a trailing match to start only at the beginning of its punctuation run. The character class, end anchor, normalization outputs and admission rules remain unchanged; the matcher no longer retries from every interior position. No message-size cap, new abort policy, retry behavior, configuration or protocol change.
Merged current main
828b81ad1f94f2a1d47692caf781cf02eb72af78as requested. Preserve the contributor commits. Consolidate the standalone timing case into the existing admission-semantics coverage, removing duplicate casing examples and helper-output mirrors. Final production +6, test/helper delta 0, two files.Evidence
Exact head
c42ecae972a83d686f5f65042e1b333529f24fe8.Built Gateway proof, controls and CPU evidence, using the prewritten measurement rule.
Official Node 24.22.1, secretless Docker, real built Gateway and ordinary authenticated
chat.send; a task-local streamed provider fixture completes the turns. The private stress input is a long punctuation-heavy non-command message with a non-punctuation terminator. Its exact contents, size and generator are not published.The main-thread CPU profile attributes about 18,084.7 ms to the shared abort normalizer family on main versus 4.8 ms on candidate. Both refs use identical profiler flags. These two serial warm samples demonstrate this responsiveness regression; they are not a throughput or percentile benchmark.
Controls twice per ref: a normal punctuated Stop word aborts the exact held run and closes its provider stream; ordinary authored text remains unchanged in native history and provider input. Stress messages remain admitted ordinary turns and complete. No mock Gateway, preload, channel-specific or unauthenticated-input claim.
111,811 bounded semantic inputs have identical normalization and abort decisions. Candidate owner suite: 28 tests pass. The consolidated timing regression fails on main at 1,690.0 ms against its 500 ms bound and passes with the fix. Core build, targeted lint, formatting and whitespace pass.
The earlier SQLite conflict belongs to the contributor's prior head. Current-head CI is evaluated separately after the main merge; it is not treated as inherited without matching evidence.
Merge Danger
Two-way door: revert restores the old scan behavior with no state rollback. Blast radius is the shared abort-text matcher used by inbound admission and reply handling. Matching semantics, authorization, stored text, schemas, configuration and public interfaces are unchanged.