Skip to content

fix(active-memory): pause recall after spaced timeouts - #181297

Merged
steipete merged 3 commits into
mainfrom
fix/am-breaker
Oct 23, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/am-breaker

Conversation

@steipete

@steipete steipete commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Related: #180978. Thanks @nikolay-bratanov for the report and detailed timing evidence.

What Problem This Solves

Fixes Active Memory forgetting consecutive recall timeouts when the gap between failures exceeds the cooldown, and forgetting the failure streak before a post-cooldown attempt finishes.

User Impact

After the configured number of consecutive timeouts, eligible recalls pause for the configured cooldown. A further timeout immediately renews the pause; a completed recall clears the streak. This retains the existing elapsed-time policy: conversations whose turns are always farther apart than the cooldown can still attempt recall every turn. No settings or migration are added.

Why This Change Was Made

The timeout recorder swept out old entries before incrementing them, including the key it was updating. The cooldown check also deleted a tripped record. Keep outcome-based streaks in the existing owner and rely on its existing 1,000-key recency capacity bound. The old test explicitly expected the faulty reset; its replacement proves spaced and interleaved failures, with a hook-level lifecycle test for pause, failed probe, successful recovery, and fresh failures.

The configuration reference and manifest help now describe the corrected behavior. No new timer, cache, storage, or concurrent-probe protocol. Production TypeScript +5/-15; tests +105/-96; docs/help/generated hashes +13/-13 against the merge base.

Evidence

  • Controlled-clock state-owner regression: the two intended cases fail on the original code; all 8 owner tests pass with the fix (35.19 s red / 27.83 s green wall time).
  • Full hook suite: 96/97 passed (475.57 s wall). Cold SQLite setup exposed an unchanged diagnostic test's real preflight deadline; its controlled-clock repair passed. A targeted follow-up exposed an existing deadline fixture's event-loop polling race, which could leak an unfinished recall into the next test. Replaced polling with the actual embedded-agent entry signal, preserving deadline assertions. The ordered deadline → near-limit → breaker lifecycle rerun passed 3/3 (433.21 s wrapper wall time, 380.56 s Vitest including cold compilation/import).
  • Exact-head CI and openclaw/ci-gate passed.
  • Full build passed (21m47.9s phase total), extension production/test typechecks and scoped lint passed, all 9 baseline ratchets passed. Final independent Codex review: scoped-clean, no actionable P0–P2 findings.
  • Built Gateway before/after, macOS arm64, Node 26.12.1, persistent chat.send session, real nomic-embed-text index/search, 250 ms recall timeout and 5 s cooldown: base recorded three 251–253 ms timeouts 8.47/9.10 s apart, then started a fourth recall 326 ms after the third timeout. Fixed code recorded 252–282 ms timeouts 9.25/9.42 s apart, then skipped the fourth recall dispatched 380 ms after the third timeout. A failed cooldown probe immediately re-paused on the fix. These short-budget runs use native Ollama wire fixtures; their first three attempts expire during setup before provider dispatch.
  • Supplementary built-Gateway lifecycle with real Ollama main qwen2.5-coder:1.5b-instruct, recall qwen3:8b, and a constant 1 s recall budget: all three initial timeouts reached actual inference (1002–1004 ms, gaps 13.60/8.59 s); fourth turn skipped 487 ms after the third timeout. Failed probe re-paused. An explicitly synthetic fast recovery response retrieved the canary through real memory_get and completed in 562 ms, with unchanged agent/provider/model/config. Three subsequent real-model timeouts were admitted, then the fourth skipped again, proving reset.
  • Separate all-real Ollama control under a 30 s budget: recall completed with no_relevant_memory in 16.58 s and the main model answered (24.96 s total).

Limitations: local macOS proof only. The 250 ms budget cannot complete grounded recall on this host; successful same-process reset is proven with the constant 1 s budget and synthetic recovery response above. Sparse-chat backoff beyond the configured cooldown remains outside this repair, so this PR relates to the issue without closing the broader policy request.

Retain timeout streaks across cooldowns while preserving bounded per-model state. A failed cooldown retry renews the pause; completed recall clears the streak.

Related: #180978. Thanks to @nikolay-bratanov for the detailed report.
Keep the untimed unconfigured-agent diagnostic test on a controlled clock. Cold SQLite setup can exceed the real 1.5-second preflight deadline before the expected log is reached; deadline behavior remains covered separately.
Replace event-loop polling with the existing deferred helper so cold SQLite setup cannot fail the assertion early and leak an unfinished recall into the next test. Preserve the fake-clock timeout and cleanup assertions.
@clawsweeper

clawsweeper Bot commented Oct 23, 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 extensions: active-memory size: M labels Oct 23, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 23, 2026
@steipete
steipete marked this pull request as ready for review October 23, 2026 04:16
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-23T04:16:29.656740Z 8520bc0 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot removed the clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. label Oct 23, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR preserves consecutive Active Memory timeout counts across cooldowns and immediately renews the pause after a failed retry.

Example: Three recall timeouts occur 9 seconds apart with a threshold of 3 and a 5-second cooldown.

  • Before: Each timeout restarts the count at one, so another recall starts immediately afterward.
  • After: The third timeout reaches the threshold, and another recall within 5 seconds is skipped.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct repair with documented shipped-entry behavior and passing exact-head gates; overall scope remains partial against the broader linked request.
Proof confidence 🐚 platinum hermit (4/6) The maintainer-authored PR is outside the ordinary contributor proof gate; its body records macOS built-Gateway chat.send comparisons, actual inference timeouts, skipped recalls, failed-retry re-pausing, and recovery using an explicitly synthetic fast response.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Slow recall repeatedly delays replies because spaced timeouts lose their accumulated count and failed cooldown retries lose the previous streak.
Reason: The maintainer-authored direction deliberately repairs two concrete defects without changing the elapsed-time cooldown policy; Related wording correctly preserves the broader linked request.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR fixes verified timeout-accounting defects still present on main, with no actionable introduced findings.

Priority: P2
Reviewed head: 8520bc0e2390db51fe84304f8a3f46020a9fa18e

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Active Memory plugin runs recall before prompt construction; its agent/provider/model-scoped breaker consumes recall outcomes and decides whether to run or temporarily skip the recall subagent.

flowchart TD
  A[User turn] --> B[Active Memory hook]
  B --> C[Recall owner]
  C --> D[Timeout breaker]
  D --> E[Skip during cooldown]
  D --> F[Recall subagent]
  F --> G[Record timeout or clear streak]
  G --> D
Loading

Technical review

Best possible solution:

Land the focused existing-owner repair while retaining the linked issue for the broader sparse-chat backoff policy.

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

Current main and v2026.10.6 delete spaced timeout history before incrementing it; the PR also records Gateway before/after observations, while this read-only review ran no target code.

Is this the best way to solve the issue?

This is the smallest complete repair for the stated counting and retry defects: reuse the bounded breaker owner, remove elapsed-time resets, preserve completed-recall reset, and align help text without adding probe machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Timeout streak expiry and cooldown recovery changes intended behavior with a stated reason (e69b076: The resource-bound repair deliberately expired current and peer entries and added capacity eviction; this PR explains why expiry breaks outcome-based streaks and retains the independent capacity bound.)
  • Original breaker recovery contract keeps the original intent (feat(active-memory): add timeout circuit breaker to skip recall after consecutive failures #74158: The original design described retry after cooldown, immediate re-tripping after another timeout, and reset after completed recall.)
  • Diagnostic and deadline fixtures keeps the original intent (e5bc415: Existing coverage protects skipped-agent diagnostics and deadline behavior; controlled clocks and an embedded-entry completion signal preserve those assertions while removing cold-setup timing dependence.)
  • Configuration reference and manifest help changes intended behavior with a stated reason (89cd2b6: Existing help documented cooldown-reset semantics; the PR updates both user-facing descriptions to match the explicitly selected recovery behavior without changing keys or defaults.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit fd9ac3e adds extensions/active-memory/recall-state.ts:33 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fd9ac3eb9bdd; files: extensions/active-memory/recall-state.ts)
  • ZOOWH: Raw commit e69b076 adds extensions/active-memory/recall-state.ts:59 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e69b076e8bd1; files: extensions/active-memory/recall-state.ts)
  • Tak Hoffman: Raw commit b83726d adds extensions/active-memory/openclaw.plugin.json:107 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: b83726d13e33; files: extensions/active-memory/openclaw.plugin.json)

PR surface

Source -10, Tests +9, Docs 0, Generated 0. Total -1 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 7 17 -10
Tests 4 105 96 +9
Docs 1 9 9 0
Config 0 0 0 0
Generated 1 2 2 0
Other 0 0 0 0
Total 9 123 124 -1

Labels

Label changes:

  • add P2: Repeated foreground recall delays affect slow-model deployments, with a concrete defect and configuration-dependent blast radius.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Repeated foreground recall delays affect slow-model deployments, with a concrete defect and configuration-dependent blast radius.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-23T04:44:47.959Z sha 8520bc0 :: needs maintainer review before merge. :: none

Reviewed October 23, 2026, 12:50 AM ET / 04:50 UTC (Revision 2).

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 23, 2026
@steipete
steipete merged commit 40e9a07 into main Oct 23, 2026
211 of 215 checks passed
@steipete
steipete deleted the fix/am-breaker branch October 23, 2026 04:59
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 24, 2026
* fix(active-memory): pause recall after spaced timeouts

Retain timeout streaks across cooldowns while preserving bounded per-model state. A failed cooldown retry renews the pause; completed recall clears the streak.

Related: openclaw#180978. Thanks to @nikolay-bratanov for the detailed report.

* test(active-memory): isolate diagnostics from preflight timing

Keep the untimed unconfigured-agent diagnostic test on a controlled clock. Cold SQLite setup can exceed the real 1.5-second preflight deadline before the expected log is reached; deadline behavior remains covered separately.

* test(active-memory): await recall entry in deadline proof

Replace event-loop polling with the existing deferred helper so cold SQLite setup cannot fail the assertion early and leak an unfinished recall into the next test. Preserve the fake-clock timeout and cleanup assertions.
steipete added a commit that referenced this pull request Oct 26, 2026
* test(sms): consolidate o0520 owner proof and fixtures

Keep SMS named-account and agent-fallback cap enforcement, exact-cap acceptance, the GIF transport ceiling, and per-attachment inbound budgeting. Account default selection and inherited merging remain covered by account-helpers.test.ts (normalizes account enumeration and configured default selection; merges nested fields without selection metadata or input mutation).

Remove the hosted handler replay: media.test.ts retains hosts repeat GET/HEAD fetches on the exact webhook path and serves each media type with Twilio's required filename. Preserve fixture defaults, fresh arrays, raw form signing bytes, and account isolation while removing return-only wrappers and duplicate account-id state.

* test(browser): deslop o0524 tests

Merge element command coverage into the batch registration suite and share its CLI harness. Keep malformed-input, modal replay, interruption, request construction, and timeout assertions. Consolidate stdin, symlink, and FIFO fixtures while retaining each input safety path, including the FIFO fields regression from 2337209.

Static checks: oxlint, oxfmt, git diff --check. Test LOC: 491 -> 392 (20.2% reduction). Runtime tests and coverage deferred to hosted CI under campaign CI-only mode.

* test(browser): deslop o0525 tests

Reuse configured background and relay reply helpers; share native frame fixtures and inline single-use blank commit setup. Preserve all six navigation authority and lifecycle cases.

* test(browser): consolidate o0525 navigation coverage

Remove discovery replay covered by tab-access-events.navigation.test.ts: discards a stale selected discovery snapshot of blank before return.

Remove reconnect replay covered by tab-document-provenance.test.ts: discards authority and queued events on connection before response; and background.relay-lifecycle.test.ts: detaches without waiting for old evaluation and never delivers its reply on a colliding new seq.

Child-frame provenance remains covered by does not mint provenance for a caller-constrained child frame; child-session routing by relay-command-handler.test.ts checks ordinary access around native child-session blank navigation. Retain forged authorization and unowned-tab denials here. Simplify native completion setup and retain both pending-destination rows.

* test(mattermost): deslop o0527 tests

Share setup and route fixtures while preserving credential and routing contracts. Remove the directory-group replay covered by the real-HTTP test 'preserves real public and private channel identities in outbound thread routes' in target-resolution.loopback.test.ts. CI-only validation: local oxlint, oxfmt, and diff checks; retain all distinct branches.

* test(cli): deslop o0523 tests

Consolidate model outcome assertions and ClawRouter fixtures; remove duplicated credential-case labels. Retain all local outcome, gateway status, image input, embedding recovery, and saved-account ownership cases.

* test(cli): remove redundant o0523 fixture layers

Keep successful image forwarding in capability-cli.test.ts: prepares local model content and instructions. Remove duplicate local success and cross-product diagnostic cases while retaining every error branch. Use real config snapshots and registered CLI routing for all six saved-account ownership cases, plus shared HTTP and auth-store fixtures.

* test(agents): deslop o0528 tests

Consolidate runtime classifications and assistant failure cases into tables; trim retry fixtures while preserving timing and truncation assertions.

Repeated Kimi ID pairing remains covered by embedded-agent-runner.openai-tool-id-preservation.test.ts (keeps repeated Kimi calls distinct while repairing the incomplete later turn). JSON thinking-signature replay rejection remains covered by failover/provider-structured-signals.test.ts (classifies replay-invalid carriers as terminal format failures).

CI-only shard: 430 -> 343 test lines; local oxlint, oxfmt and diff checks pass. Tests and coverage deferred to hosted CI.

* test(meetings): deslop o0529 tests

Share export fixtures and retain cancellation, retry, authority and layout assertions. Remove the keyboard replay covered by hub-tabs.test.ts (moves focus without activating routes), and the heuristic label assertion covered by transcript-library.e2e.test.ts. Keep meeting tab wiring and panel labels.

* test(meetings): consolidate o0529 pending operation coverage

Move pending tab navigation assertions into the export and summary retry cases. Keep stale selection results in the replacement-summary case and retain separate client and authorization fencing. HubTabs owns active-tab no-op behavior; meeting page cases retain navigation and the browser test retains panel labeling. Simplify export fixtures without changing production code.

* test(node-host): deslop o0526 tests

* test(node-host): consolidate o0526 boundary cases

Share the shell rejection table and retain one representative per redundant parser payload shape, including nested substitution. Keep native literal approval and every carrier guard.

Keep one worker-entry cleanup interleaving. Desktop preference variants remain in mac-worker-entry.test.ts (preserves profile and desktop preference); exit-code variants remain in one-shot-exit.test.ts. Remove internal invocation counts while retaining completion, release ordering, and bootstrap-failure assertions.

CI-only: plain oxlint, oxfmt and diff-check pass. No tests or coverage run. Cumulative shard LOC 328 -> 289; below the 20 percent target to preserve distinct security and lifecycle behavior.

* test(node-host): minimize o0526 boundary fixtures

Reduce the shard from its original 328 lines to 262. Minimize builtin rejection payloads while retaining every guard; consolidate quoted-literal inputs and retain bash as the representative of the non-sh POSIX rejection branch. Keep rawCommand for sh -lc parsing and preserve exact approved argv assertions.

Share the lifecycle no-exit assertion across cases and retain guaranteed gate release and entry settlement. Narrow the stream Gateway fixture to its only caller, portal-stream-command.test.ts; desktop-stream-command.test.ts only uses generic cleanup and streamParams. Preserve binary frame assertions, dual-stack fallback, and teardown.

CI-only validation: plain oxlint, oxfmt and git diff --check pass. No tests or coverage executed. No production changes or deleted files.

* test(ui): deslop o0531 tests

Reuse existing Logbook payload fixtures and consolidate repeated mounting, queries, and reopen steps. Keep all distinct action, refresh, pruning, eviction, and connection-retirement behavior.

The shared-keyframe readiness test covers the removed duplicate-reader case at the rendered boundary: both cards stay pending on one request and receive the same data URL. Preserve that regression from 5a54a0a.

CI-only validation: oxfmt, plain oxlint, and git diff --check passed. Test lines 439 -> 350; declarations 10 -> 9; expanded cases 14 -> 13. No local tests or coverage run.

* test(llm): deslop o0530 tests

Share synchronous stream failure setup and trim fixture bookkeeping. Keep all 13 expanded cases and all auth, sentinel rejection, null-header and storage-outcome boundaries.

Remove duplicate built-in registry checks: packages/ai/src/transports/simple-completion-transport.test.ts covers them in 'aliases a provider-owned stream while preserving its null auth-header marker'. Keep direct Responses default replay proof using encrypted reasoning; the shared converter test 'omits Responses replay item ids when requested by store-disabled callers' retains text and tool-call conversion assertions.

CI-only validation: plain oxlint, oxfmt and diff-check pass. Tests and coverage intentionally not run. Shard LOC 440 to 394 (10.5%); further reductions would discard distinct boundary proof, so this stops below the 20% target.

* test(llm): remove duplicate o0530 proof layers

Reduce the shard from 394 to 352 lines, reaching 20% below its original 440 lines. Keep all test declarations and distinct auth, sentinel, stream initialization, storage projection and user-facing recovery behavior.

Capture explicit bearer auth at fetch instead of replaying SSE. Successful completion remains covered by packages/ai/src/providers/openai-completions.test.ts, including 'surfaces aggregated chat-completions message.refusal as visible assistant text'.

Run shared stream error projection once per distinct error, retaining both entry points for deferred startup. Remove duplicate downstream classification/retry assertions covered by src/infra/sqlite-worker-contract.test.ts ('keeps rollback nonterminal' and 'classifies canonical and impersonated unavailability') and src/agents/embedded-agent-runner/run/attempt-recovery.storage-outcomes.test.ts ('keeps typed storage terminal=...'). Preserve projected errorCode/errorType checks and recovery-copy assertions here.

Remove redundant construction counts and network fixture fields; src/agents/provider-request-config.test.ts ('keeps exchanged request auth aligned with visible headers and authored network policy') owns network policy retention. CI-only: oxfmt, plain oxlint and diff-check pass; no test or coverage runs.

* test(active-memory): deslop o0533 tests

Retain representative localized recall and reminder boundaries in escalation tables; remove synonymous replays. The oversized-request guard precedes query-mode selection, so its full-mode case covers the removed message/recent replays. Share circuit eviction setup while preserving refresh, threshold, cooldown, reset and identity assertions. Keep the spaced-timeout regressions from #181297.

* test(ui): consolidate o0532 reader shell coverage

Merge footer geometry into the installed reader's responsive sizing and scroll lifecycle. Keep both narrow and desktop paths, chrome parity, resize recovery, and Escape dismissal. Credential input presence remains covered by view.test.tsx's nonblank credential replacement test; footer placement is also asserted there and by the missing-alternative installer test.

Reuse createSkillsData defaults without changing legacy fixture aliases, and share error-read and prototype-restoration boilerplate. CI-only validation: oxfmt, diff-check, and plain oxlint passed; no test or build commands run.

* test(session-url-contract): deslop o0534 tests

Consolidate focus URL construction and parsing in round-trip rows while retaining explicit malformed-input, mounted-base, trailing-slash, and control-selector assertions. Keep literal session parsing in its existing owner table and share compact expected-result fixtures.

Static preservation: focus round-trips retain browser host/node, desktop source/session/control precedence, terminal, and dashboard query/hash behavior. Session parser rows retain forced literals, dot escaping, reserved boot, and mounted multi-segment keys. No production or test-support changes; no runtime tests under the campaign CI-only policy.

* test(session-url-contract): consolidate o0534 URL suite

Move retained parse.test.ts cases into index.test.ts under the same package Vitest routing. Share URL fixtures and builder helpers, put configured-main and invalid-share cases in their owner tables, and trim focus fixtures while preserving escaping and selector assertions.

The retained round-trips exact key cases cover the removed bare-slug and forced-literal parser duplicates. The retained focus parses mounted dashboard case covers shared trailing-slash normalization. No production changes or test runs; plain oxlint, formatting and diff checks pass. Original shard: 432 lines; final: 342 lines (-20.8%).

* test(daemon): deslop o0535 tests

Flatten schtasks executor cases and compact their fixtures and assertions. Keep malformed and out-of-range HRESULT, termination, environment isolation, timeout, fallback, and cleanup-uncertainty contracts.

The retained confirmed native HRESULT case covers the same parser branch as the removed second numeric error code. Keep all startup recovery and platform backup mocks unchanged; they protect distinct lifecycle and native isolation boundaries. Static oxlint and formatting checks pass; runtime proof is deferred to hosted CI under campaign CI-only mode.

* test(daemon): consolidate o0535 fixtures and outcomes

Share export-preserving native mock factories and remove unreachable LaunchAgent port-probe and cleanup mocks: the fixture fixes its context port to null. Keep Windows port inspection, which bounded takeover still uses.

Consolidate successful, timed-out and signaled schtasks outcomes with exact result, timeout and environment checks. The retained timeout HRESULT case covers the same non-exit rejection guard as the removed signal variant. Remove redundant defined assertions; the retained recycled-PID and successful-stop cases still require the captured owner.

Join child cleanup while retaining the holder exit handler as the lock-release owner. CI-only: formatting, diff-check and plain oxlint pass; no test/build commands run. Original shard 322 lines to 257 (20.2% reduction).

* test(net-policy): deslop o0538 tests

Share credential fixtures and table-driven redaction assertions while retaining malformed, opaque, encoded, and safe URL contracts. Consolidate IP classification assertions.

Remove repeated RFC8215 address layouts: classifies private/internal IPv6 addresses retains blocking, and extracts embedded IPv4 without guessing local-use NAT64 retains undefined extraction. Both exercise the same 64:ff9b:1::/48 prefix guard.

* test(cua-computer): deslop o0537 tests

* test(cua-computer): consolidate o0537 fixtures

Share recording replies and package manifest fixtures; remove unused driver fixture fields and options. The installed SDK import-conditions test retains the successful artifact verification covered by the removed synthetic acceptance case on Linux and Windows. Preserve all recording redaction, replay escape, shutdown ordering, and artifact failure assertions.

* test(cua-computer): trim o0537 fixture plumbing

Reuse the existing test-finished mock cleanup, remove the unused capture override, and project minimal fixture state. Seed the replay trajectory after starting the recording instead of through an extra mock callback. Preserve all remaining cases and assertions.

* test(utils): deslop o0539 tests

Consolidate queue summary preview, ordered elision, and UTF-16 truncation assertions around one fixture. Retain all protected/in-flight queue and debounce cases, and every concurrency interleaving.

Share directive stress assertions and trim table metadata without removing distinct parsing or whitespace cases. CI-only validation: plain oxlint, oxfmt, and diff-check; no tests or coverage run. Reduction remains below 20% because retained behaviors have no duplicate owner proof.

* test(utils): consolidate o0539 owner scenarios

Move submitted-array mutation coverage into the bounded-worker ordering case. Preserve first-error identity, callback indexes, and continued completion in the context-isolation table, including nonthrowing hooks.

Share debounce setup across cancellation, requeue, and clock rollback. Table-drive directive stripping and trim fixture text while retaining whitespace, Unicode, and protected-queue assertions.

Cumulative shard size: 429 to 343 lines. CI-only: oxfmt, plain oxlint, and git diff --check pass; no tests or coverage run.

* test(node-host): preserve partial denial matching after replay

* test(net-policy): preserve security vectors and bind table arguments

* test: repair d623 fixture types and shrink mock baseline

* test(cli): infer embedding fixture inputs from the provider contract
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
…184944)

* test(sms): consolidate o0520 owner proof and fixtures

Keep SMS named-account and agent-fallback cap enforcement, exact-cap acceptance, the GIF transport ceiling, and per-attachment inbound budgeting. Account default selection and inherited merging remain covered by account-helpers.test.ts (normalizes account enumeration and configured default selection; merges nested fields without selection metadata or input mutation).

Remove the hosted handler replay: media.test.ts retains hosts repeat GET/HEAD fetches on the exact webhook path and serves each media type with Twilio's required filename. Preserve fixture defaults, fresh arrays, raw form signing bytes, and account isolation while removing return-only wrappers and duplicate account-id state.

* test(browser): deslop o0524 tests

Merge element command coverage into the batch registration suite and share its CLI harness. Keep malformed-input, modal replay, interruption, request construction, and timeout assertions. Consolidate stdin, symlink, and FIFO fixtures while retaining each input safety path, including the FIFO fields regression from 565e237.

Static checks: oxlint, oxfmt, git diff --check. Test LOC: 491 -> 392 (20.2% reduction). Runtime tests and coverage deferred to hosted CI under campaign CI-only mode.

* test(browser): deslop o0525 tests

Reuse configured background and relay reply helpers; share native frame fixtures and inline single-use blank commit setup. Preserve all six navigation authority and lifecycle cases.

* test(browser): consolidate o0525 navigation coverage

Remove discovery replay covered by tab-access-events.navigation.test.ts: discards a stale selected discovery snapshot of blank before return.

Remove reconnect replay covered by tab-document-provenance.test.ts: discards authority and queued events on connection before response; and background.relay-lifecycle.test.ts: detaches without waiting for old evaluation and never delivers its reply on a colliding new seq.

Child-frame provenance remains covered by does not mint provenance for a caller-constrained child frame; child-session routing by relay-command-handler.test.ts checks ordinary access around native child-session blank navigation. Retain forged authorization and unowned-tab denials here. Simplify native completion setup and retain both pending-destination rows.

* test(mattermost): deslop o0527 tests

Share setup and route fixtures while preserving credential and routing contracts. Remove the directory-group replay covered by the real-HTTP test 'preserves real public and private channel identities in outbound thread routes' in target-resolution.loopback.test.ts. CI-only validation: local oxlint, oxfmt, and diff checks; retain all distinct branches.

* test(cli): deslop o0523 tests

Consolidate model outcome assertions and ClawRouter fixtures; remove duplicated credential-case labels. Retain all local outcome, gateway status, image input, embedding recovery, and saved-account ownership cases.

* test(cli): remove redundant o0523 fixture layers

Keep successful image forwarding in capability-cli.test.ts: prepares local model content and instructions. Remove duplicate local success and cross-product diagnostic cases while retaining every error branch. Use real config snapshots and registered CLI routing for all six saved-account ownership cases, plus shared HTTP and auth-store fixtures.

* test(agents): deslop o0528 tests

Consolidate runtime classifications and assistant failure cases into tables; trim retry fixtures while preserving timing and truncation assertions.

Repeated Kimi ID pairing remains covered by embedded-agent-runner.openai-tool-id-preservation.test.ts (keeps repeated Kimi calls distinct while repairing the incomplete later turn). JSON thinking-signature replay rejection remains covered by failover/provider-structured-signals.test.ts (classifies replay-invalid carriers as terminal format failures).

CI-only shard: 430 -> 343 test lines; local oxlint, oxfmt and diff checks pass. Tests and coverage deferred to hosted CI.

* test(meetings): deslop o0529 tests

Share export fixtures and retain cancellation, retry, authority and layout assertions. Remove the keyboard replay covered by hub-tabs.test.ts (moves focus without activating routes), and the heuristic label assertion covered by transcript-library.e2e.test.ts. Keep meeting tab wiring and panel labels.

* test(meetings): consolidate o0529 pending operation coverage

Move pending tab navigation assertions into the export and summary retry cases. Keep stale selection results in the replacement-summary case and retain separate client and authorization fencing. HubTabs owns active-tab no-op behavior; meeting page cases retain navigation and the browser test retains panel labeling. Simplify export fixtures without changing production code.

* test(node-host): deslop o0526 tests

* test(node-host): consolidate o0526 boundary cases

Share the shell rejection table and retain one representative per redundant parser payload shape, including nested substitution. Keep native literal approval and every carrier guard.

Keep one worker-entry cleanup interleaving. Desktop preference variants remain in mac-worker-entry.test.ts (preserves profile and desktop preference); exit-code variants remain in one-shot-exit.test.ts. Remove internal invocation counts while retaining completion, release ordering, and bootstrap-failure assertions.

CI-only: plain oxlint, oxfmt and diff-check pass. No tests or coverage run. Cumulative shard LOC 328 -> 289; below the 20 percent target to preserve distinct security and lifecycle behavior.

* test(node-host): minimize o0526 boundary fixtures

Reduce the shard from its original 328 lines to 262. Minimize builtin rejection payloads while retaining every guard; consolidate quoted-literal inputs and retain bash as the representative of the non-sh POSIX rejection branch. Keep rawCommand for sh -lc parsing and preserve exact approved argv assertions.

Share the lifecycle no-exit assertion across cases and retain guaranteed gate release and entry settlement. Narrow the stream Gateway fixture to its only caller, portal-stream-command.test.ts; desktop-stream-command.test.ts only uses generic cleanup and streamParams. Preserve binary frame assertions, dual-stack fallback, and teardown.

CI-only validation: plain oxlint, oxfmt and git diff --check pass. No tests or coverage executed. No production changes or deleted files.

* test(ui): deslop o0531 tests

Reuse existing Logbook payload fixtures and consolidate repeated mounting, queries, and reopen steps. Keep all distinct action, refresh, pruning, eviction, and connection-retirement behavior.

The shared-keyframe readiness test covers the removed duplicate-reader case at the rendered boundary: both cards stay pending on one request and receive the same data URL. Preserve that regression from 746ff6c.

CI-only validation: oxfmt, plain oxlint, and git diff --check passed. Test lines 439 -> 350; declarations 10 -> 9; expanded cases 14 -> 13. No local tests or coverage run.

* test(llm): deslop o0530 tests

Share synchronous stream failure setup and trim fixture bookkeeping. Keep all 13 expanded cases and all auth, sentinel rejection, null-header and storage-outcome boundaries.

Remove duplicate built-in registry checks: packages/ai/src/transports/simple-completion-transport.test.ts covers them in 'aliases a provider-owned stream while preserving its null auth-header marker'. Keep direct Responses default replay proof using encrypted reasoning; the shared converter test 'omits Responses replay item ids when requested by store-disabled callers' retains text and tool-call conversion assertions.

CI-only validation: plain oxlint, oxfmt and diff-check pass. Tests and coverage intentionally not run. Shard LOC 440 to 394 (10.5%); further reductions would discard distinct boundary proof, so this stops below the 20% target.

* test(llm): remove duplicate o0530 proof layers

Reduce the shard from 394 to 352 lines, reaching 20% below its original 440 lines. Keep all test declarations and distinct auth, sentinel, stream initialization, storage projection and user-facing recovery behavior.

Capture explicit bearer auth at fetch instead of replaying SSE. Successful completion remains covered by packages/ai/src/providers/openai-completions.test.ts, including 'surfaces aggregated chat-completions message.refusal as visible assistant text'.

Run shared stream error projection once per distinct error, retaining both entry points for deferred startup. Remove duplicate downstream classification/retry assertions covered by src/infra/sqlite-worker-contract.test.ts ('keeps rollback nonterminal' and 'classifies canonical and impersonated unavailability') and src/agents/embedded-agent-runner/run/attempt-recovery.storage-outcomes.test.ts ('keeps typed storage terminal=...'). Preserve projected errorCode/errorType checks and recovery-copy assertions here.

Remove redundant construction counts and network fixture fields; src/agents/provider-request-config.test.ts ('keeps exchanged request auth aligned with visible headers and authored network policy') owns network policy retention. CI-only: oxfmt, plain oxlint and diff-check pass; no test or coverage runs.

* test(active-memory): deslop o0533 tests

Retain representative localized recall and reminder boundaries in escalation tables; remove synonymous replays. The oversized-request guard precedes query-mode selection, so its full-mode case covers the removed message/recent replays. Share circuit eviction setup while preserving refresh, threshold, cooldown, reset and identity assertions. Keep the spaced-timeout regressions from openclaw#181297.

* test(ui): consolidate o0532 reader shell coverage

Merge footer geometry into the installed reader's responsive sizing and scroll lifecycle. Keep both narrow and desktop paths, chrome parity, resize recovery, and Escape dismissal. Credential input presence remains covered by view.test.tsx's nonblank credential replacement test; footer placement is also asserted there and by the missing-alternative installer test.

Reuse createSkillsData defaults without changing legacy fixture aliases, and share error-read and prototype-restoration boilerplate. CI-only validation: oxfmt, diff-check, and plain oxlint passed; no test or build commands run.

* test(session-url-contract): deslop o0534 tests

Consolidate focus URL construction and parsing in round-trip rows while retaining explicit malformed-input, mounted-base, trailing-slash, and control-selector assertions. Keep literal session parsing in its existing owner table and share compact expected-result fixtures.

Static preservation: focus round-trips retain browser host/node, desktop source/session/control precedence, terminal, and dashboard query/hash behavior. Session parser rows retain forced literals, dot escaping, reserved boot, and mounted multi-segment keys. No production or test-support changes; no runtime tests under the campaign CI-only policy.

* test(session-url-contract): consolidate o0534 URL suite

Move retained parse.test.ts cases into index.test.ts under the same package Vitest routing. Share URL fixtures and builder helpers, put configured-main and invalid-share cases in their owner tables, and trim focus fixtures while preserving escaping and selector assertions.

The retained round-trips exact key cases cover the removed bare-slug and forced-literal parser duplicates. The retained focus parses mounted dashboard case covers shared trailing-slash normalization. No production changes or test runs; plain oxlint, formatting and diff checks pass. Original shard: 432 lines; final: 342 lines (-20.8%).

* test(daemon): deslop o0535 tests

Flatten schtasks executor cases and compact their fixtures and assertions. Keep malformed and out-of-range HRESULT, termination, environment isolation, timeout, fallback, and cleanup-uncertainty contracts.

The retained confirmed native HRESULT case covers the same parser branch as the removed second numeric error code. Keep all startup recovery and platform backup mocks unchanged; they protect distinct lifecycle and native isolation boundaries. Static oxlint and formatting checks pass; runtime proof is deferred to hosted CI under campaign CI-only mode.

* test(daemon): consolidate o0535 fixtures and outcomes

Share export-preserving native mock factories and remove unreachable LaunchAgent port-probe and cleanup mocks: the fixture fixes its context port to null. Keep Windows port inspection, which bounded takeover still uses.

Consolidate successful, timed-out and signaled schtasks outcomes with exact result, timeout and environment checks. The retained timeout HRESULT case covers the same non-exit rejection guard as the removed signal variant. Remove redundant defined assertions; the retained recycled-PID and successful-stop cases still require the captured owner.

Join child cleanup while retaining the holder exit handler as the lock-release owner. CI-only: formatting, diff-check and plain oxlint pass; no test/build commands run. Original shard 322 lines to 257 (20.2% reduction).

* test(net-policy): deslop o0538 tests

Share credential fixtures and table-driven redaction assertions while retaining malformed, opaque, encoded, and safe URL contracts. Consolidate IP classification assertions.

Remove repeated RFC8215 address layouts: classifies private/internal IPv6 addresses retains blocking, and extracts embedded IPv4 without guessing local-use NAT64 retains undefined extraction. Both exercise the same 64:ff9b:1::/48 prefix guard.

* test(cua-computer): deslop o0537 tests

* test(cua-computer): consolidate o0537 fixtures

Share recording replies and package manifest fixtures; remove unused driver fixture fields and options. The installed SDK import-conditions test retains the successful artifact verification covered by the removed synthetic acceptance case on Linux and Windows. Preserve all recording redaction, replay escape, shutdown ordering, and artifact failure assertions.

* test(cua-computer): trim o0537 fixture plumbing

Reuse the existing test-finished mock cleanup, remove the unused capture override, and project minimal fixture state. Seed the replay trajectory after starting the recording instead of through an extra mock callback. Preserve all remaining cases and assertions.

* test(utils): deslop o0539 tests

Consolidate queue summary preview, ordered elision, and UTF-16 truncation assertions around one fixture. Retain all protected/in-flight queue and debounce cases, and every concurrency interleaving.

Share directive stress assertions and trim table metadata without removing distinct parsing or whitespace cases. CI-only validation: plain oxlint, oxfmt, and diff-check; no tests or coverage run. Reduction remains below 20% because retained behaviors have no duplicate owner proof.

* test(utils): consolidate o0539 owner scenarios

Move submitted-array mutation coverage into the bounded-worker ordering case. Preserve first-error identity, callback indexes, and continued completion in the context-isolation table, including nonthrowing hooks.

Share debounce setup across cancellation, requeue, and clock rollback. Table-drive directive stripping and trim fixture text while retaining whitespace, Unicode, and protected-queue assertions.

Cumulative shard size: 429 to 343 lines. CI-only: oxfmt, plain oxlint, and git diff --check pass; no tests or coverage run.

* test(node-host): preserve partial denial matching after replay

* test(net-policy): preserve security vectors and bind table arguments

* test: repair d623 fixture types and shrink mock baseline

* test(cli): infer embedding fixture inputs from the provider contract
RomneyDa added a commit that referenced this pull request Oct 28, 2026
* fix(active-memory): pause recall after spaced timeouts

Retain timeout streaks across cooldowns while preserving bounded per-model state. A failed cooldown retry renews the pause; completed recall clears the streak.

Related: #180978. Thanks to @nikolay-bratanov for the detailed report.

* test(active-memory): isolate diagnostics from preflight timing

Keep the untimed unconfigured-agent diagnostic test on a controlled clock. Cold SQLite setup can exceed the real 1.5-second preflight deadline before the expected log is reached; deadline behavior remains covered separately.

* test(active-memory): await recall entry in deadline proof

Replace event-loop polling with the existing deferred helper so cold SQLite setup cannot fail the assertion early and leak an unfinished recall into the next test. Preserve the fake-clock timeout and cleanup assertions.

(cherry picked from commit 40e9a07)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 1fbd3f6c457caac28545531a5bb37d2a273d3826)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: active-memory P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

1 participant