Skip to content

refactor(auto-reply): deslop reply routing and sessions - #163997

Merged
steipete merged 4 commits into
mainfrom
deslop/l320-simplify-autoreply-routing-sessions-20261002
Oct 3, 2026
Merged

steipete merged 4 commits into
mainfrom
deslop/l320-simplify-autoreply-routing-sessions-20261002

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Reply execution, command handling, routing, and session helpers still carry unused options, duplicate result shapes, and forwarding layers with no independent responsibility.

User Impact

The refactors preserve config keys, command output, prompt text, persisted data, wire shapes, plugin SDK contracts, and cancellation/authorization behavior. HTML exports also render malformed read-range arguments as literal text, and Escape restores sidebar rows when it clears a search. No migration or operator action is required.

Why This Change Was Made

This is one subsystem cleanup batch, with 1,100 net production lines removed, excluding tests, fixtures, and generated files.

  • Construct the canonical settled agent-turn outcome once; keep post-cleanup cancellation and compaction settlement in the outer owner.
  • Replace the audio buffer strategy interface and factory with the concrete behavior that its only implementation provides.
  • Remove unused rotation-preparation state, one-turn model override forwarding, attachment injection/index switches, and cron-store override plumbing.
  • Share message-tool availability policy resolution while preserving each caller's distinct group and sender context.
  • Simplify command registry/menu/native-name projections, move constant registry invariants to their existing contract tests, and remove an impossible slash-parser error variant plus redundant set/unset callbacks.
  • Let private command routing build its approval request; inline one-use command, session-reset, media-staging, account, and route-cache adapters.
  • Select session-ID aliases directly and reuse canonical normalization, truncation, JSON parsing, and bounded-settlement helpers.
  • Preserve explicit public/private projections, lazy runtime imports, generation fences, delivery custody, and FIFO/cancellation contracts.

Fixes Found Along the Way

  • Archived read arguments can contain invalid values even when tool execution rejects them. Escape the complete displayed line-range label with the existing HTML owner so those values cannot become markup; valid numeric ranges retain their output.
  • Clearing search with Escape left the sidebar render cache marked current. Invalidate it before navigation so the cleared query rebuilds the visible rows.

Evidence

Earlier Refactor Validation

  • Independent review through P2 on the rebased candidate is scoped-clean. Earlier findings were checked against the canonical owners and resolved with caller evidence.
  • Both new export regressions fail on the original template for the intended DOM differences. The patched output/security selection passes all 30 tests (16.53 seconds wall time for the two-file runner invocation); valid numeric read ranges remain unchanged. The two new cases took 62 milliseconds in that run. Hosted CI timing remains pending.
  • The real Chrome before/after captures below use the production HTML template, generated vendor assets, and synthetic conversation data. After searching and pressing Escape, the fixed sidebar restores the middle entry and displays the malformed range as literal text. Captures were inspected and cropped to synthetic page content.
  • Blacksmith Testbox failed during hydration before running checks; the direct AWS broker also timed out. Task leases are stopped. Validation used the authorized low-priority local fallback, one test/check command at a time.
  • Final focused owner-contract selection: 63 tests passed across 30 files on the rebased head with node scripts/run-vitest.mjs <owner files> -t <contract names> --maxWorkers=2 (975.25 seconds wall time on the overloaded Mac, including worker preparation). This covers command identity/config writes, model selection, audio custody, queue FIFO/cancellation, rollover/snooze, memory compaction, and settled execution results. The new registry invariant case took 52 milliseconds.
  • Both final architecture checks passed on the rebased head: node --import ./scripts/tsx.mjs scripts/check-madge-import-cycles.ts reported 0 cycles, and node --import ./scripts/tsx.mjs scripts/check-import-cycles.ts reported 0 runtime value cycles.
  • Completed earlier proof: 26 test files / 390 tests. Broader local selections were interrupted under host load and are partial evidence, not full-suite passes. Full changed-file lint/typecheck validation is delegated to hosted CI on the exact pushed head.

Before: clearing search leaves a row hidden and the read offset becomes markup

After: clearing search restores all rows and the read offset remains literal text

CI Recovery

Rebased onto current main before repairing the failed run. All failures in run 37093092247 were branch-caused:

  • Migrated the directive-delivery harness to the concrete audio-buffer pipeline API. This fixes all 21 compact-small-4 failures and both core-1 test-type diagnostics without changing assertions.
  • Registered the JSON-coercion browser subpath in Vite. The missing alias caused build-artifacts, six UI E2E shards, both real-Gateway UI shards, and control-ui-performance to fail before their tests.
  • Gave the reply message-tool policy helper a distinct exported name from Doctor's preview helper.
  • Removed five shadowed bindings and temporary conditional-spread allocations in persisted media projection, preserving omitted fields and input immutability.
  • Regenerated the assertion-safety baseline with shrink-only counts for the removed assertions.

Repair validation on the rebased candidate:

  • Focused tests: 278 passed across 8 files, one worker, 572.08 seconds wall time including compiled-worker preparation. The previously failing directive-delivery file passes all 26 existing cases, including the 21 previously failing cases, with unchanged assertions (2.215 seconds of case time locally). The corrective head subsequently passed hosted CI; the repaired mobile login case took 743 ms and its full 23-case file took 23.126 seconds.
  • pnpm ui:build passed.
  • Madge: 0 cycles. Runtime import check: 0 value cycles.
  • Targeted native lint and formatting passed; the exact agents-root test-types leaf passed.
  • Export-name collision guard, assertion-safety regeneration, database-worker ratchet, and test-timeout-race ratchet passed. Assertion baseline decreased from 7,624 to 7,622 sites.
  • Fresh independent autoreview of the CI repair delta through P2: scoped-clean.

Hosted run 37094685836 on 771840e8e81c1cb94596072758a5e7e5d4478165 completed with 78 successful jobs. Every originally reported branch defect is green, including build-artifacts, control-ui-performance, core lint, agents test types, source contracts, fast baseline ratchets, and all Node test shards. That run’s remaining root failure was UI E2E shard 4/9: login-gate.e2e.test.ts / “keeps mobile controls compact, touchable, and keyboard-friendly” expected the synthetic connection counter to be 1 after Enter but observed 0. The aggregate gate consequently failed.

A bounded comparison of 24 hours of scheduled main CI found no matching mobile assertion failure, so the fixture was repaired instead of using a pre-existing-main exception. A deterministic local probe reproduces the exact counter failure by forcing one parent app render: the app reinstalls its real connection callback over the fixture counter. The two-file follow-up fixture repair is published as e701e161d2ca02a56735b1b9931f4de6b2240fcf. It preserves the app callback, observes the second real mock-Gateway connection request after Enter, and retains every layout assertion. The full 23-case browser suite passes (89.65 seconds; mobile case 1.349 seconds), UI fixture types and targeted native lint pass, and independent review through P2 is scoped-clean. Final exact-head CI 37096839188 passed on e701e161d2ca02a56735b1b9931f4de6b2240fcf, including UI shard 4/9, both real-Gateway shards, and the aggregate gate. GitHub squash auto-merged the PR as 6706f9d825ca4002543aab83f418f6ab82d8653e. No admin exception or waived failure was used. The merge is verified as an ancestor of fetched origin/main; its tree also matches Git's merge of the actual landed parent and the reviewed head.

@clawsweeper

clawsweeper Bot commented Oct 3, 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 3, 2026, 12:38 AM ET / 04:38 UTC (Revision 5).

ClawSweeper review

What this changes

The branch simplifies reply execution, command routing, and session helpers, repairs exported conversation rendering and search clearing, and updates affected browser and test callers.

Merge readiness

⛔ Blocked before merge - 2 items remain

This PR remains useful: current main still has both export defects. The earlier concrete findings are resolved, and the inspected diff does not support retaining the generic compatibility warning. No blocking introduced defect was found.

Priority: P3
Reviewed head: e701e161d2ca02a56735b1b9931f4de6b2240fcf

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful consolidation with direct visual proof and resolved prior findings; no additional code or proof blocker was identified.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected production-template Chrome before/after captures directly demonstrate restored sidebar rows and literal malformed read-range text. Reply refactors have supplemental contract/CI evidence and the maintainer-author exemption applies; no stored-data format changes require migration proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected production-template Chrome before/after captures directly demonstrate restored sidebar rows and literal malformed read-range text. Reply refactors have supplemental contract/CI evidence and the maintainer-author exemption applies; no stored-data format changes require migration proof.
Evidence reviewed 9 items Pinned ownership and review continuity: Reviewed the merge-base-to-head introduced hunks, including files omitted from the prompt inventory. The latest commit changes only the two login-gate test files; production changes are unchanged from the previous reviewed head. The supplied test merge is stale and was not used to infer removal of main-branch behavior.
Central fixes remain necessary: Pinned current main still interpolates read-range values into HTML without escaping and clears the search query without invalidating the tree render cache. The branch escapes the complete range label and invalidates the cache before navigation.
Inspected production-template proof: Inspected both downloaded Chrome captures from the captured PR body. Before: the middle sidebar entry is missing and the malformed range becomes markup. After: the middle entry returns and the complete markup-valued offset appears literally. These demonstrate the visible export fixes, without claiming broader runtime or security coverage.
Findings None None.
Security None None.

How this fits together

OpenClaw's reply subsystem turns incoming messages and commands into agent runs, session updates, and channel replies. Its conversation exporter renders stored messages and tool arguments into a browsable HTML transcript.

flowchart TD
  A[Incoming messages and commands] --> B[Command and routing policies]
  B --> C[Session preparation]
  C --> D[Agent execution and settlement]
  D --> E[Channel replies]
  D --> F[Stored conversation]
  F --> G[HTML transcript and search]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files, vector/embedding metadata: src/auto-reply/reply/memory-flush-errors.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep one canonical reply and session path that preserves existing policies and stored state, with safely rendered export arguments and correctly refreshed search results.

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

Yes, from source: render a conversation with a markup-valued read offset, or search its sidebar and press Escape. Pinned main retains both faulty operations; supplied Chrome captures show before/after behavior, but this review did not execute target code.

Is this the best way to solve the issue?

Yes. The branch uses the existing HTML escaping and render-cache owners, consolidates equivalent reply policies, and removes unused internal forwarding without introducing a parallel public contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is primarily internal simplification with bounded transcript-rendering fixes; pending CI does not increase its product priority.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected production-template Chrome before/after captures directly demonstrate restored sidebar rows and literal malformed read-range text. Reply refactors have supplemental contract/CI evidence and the maintainer-author exemption applies; no stored-data format changes require migration proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected production-template Chrome before/after captures directly demonstrate restored sidebar rows and literal malformed read-range text. Reply refactors have supplemental contract/CI evidence and the maintainer-author exemption applies; no stored-data format changes require migration proof.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected production-template Chrome before/after captures directly demonstrate restored sidebar rows and literal malformed read-range text. Reply refactors have supplemental contract/CI evidence and the maintainer-author exemption applies; no stored-data format changes require migration proof.

Evidence

What I checked:

  • Pinned ownership and review continuity: Reviewed the merge-base-to-head introduced hunks, including files omitted from the prompt inventory. The latest commit changes only the two login-gate test files; production changes are unchanged from the previous reviewed head. The supplied test merge is stale and was not used to infer removal of main-branch behavior. (e701e161d2ca)
  • Central fixes remain necessary: Pinned current main still interpolates read-range values into HTML without escaping and clears the search query without invalidating the tree render cache. The branch escapes the complete range label and invalidates the cache before navigation. (src/auto-reply/reply/export-html/template.js:913, df883d4cc7bd)
  • Inspected production-template proof: Inspected both downloaded Chrome captures from the captured PR body. Before: the middle sidebar entry is missing and the malformed range becomes markup. After: the middle entry returns and the complete markup-valued offset appears literally. These demonstrate the visible export fixes, without claiming broader runtime or security coverage.
  • Compatibility warning checked against callers: The pinned base has no production caller supplying the removed one-turn override and no caller of the deleted rotation-preparation method. The remaining skip-stored-model option is still used directly by the automatic fallback probe. These removals do not establish a changed user setting or default. (src/auto-reply/reply/model-selection.ts:126, e701e161d2ca)
  • Policy and authority preservation: The shared reply-policy helper retains profile, provider, agent, group, subagent, and inherited policy layers while callers retain their distinct contexts. Private routing still constructs the same approval request fields and restricts targets to configured owners; HandleCommandsParams already requires agentId. Inspection found no material transfer or expansion of authority. (src/auto-reply/reply/session-stable-reply-mode.ts:156, e701e161d2ca)
  • Stored-state contract unchanged: Session reset persistence retains the same touched fields, unlocked-selection requirement, lifecycle invalidation handling, and snapshot adoption. Session lifecycle fields and transcript export writes are inlined without changing their stored shapes; no schema, migration, or new persisted preference is introduced. (src/auto-reply/reply/session-reset-model.ts:181, e701e161d2ca)

Likely related people:

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

Rating scale

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

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

Workflow

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

History

Review history (4 earlier review cycles)
  • reviewed 2026-10-03T03:29:00.513Z sha e7f60a83f0922940c7f44440bd9e5bf212232cb0 :: blocked before merge. :: [P2] Migrate the remaining directive-delivery test caller
  • reviewed 2026-10-03T03:41:13.968Z sha e7f60a83f0922940c7f44440bd9e5bf212232cb0 :: blocked before merge. :: [P2] Migrate the remaining directive-delivery test caller | [P2] Make the JSON helper import resolve in the browser build | [P2] Give the reply-policy helper a distinct exported name | [P2] Keep the session refactor within the enforced line-cap ratchet
  • reviewed 2026-10-03T04:01:09.398Z sha 771840e :: blocked before merge. :: none
  • reviewed 2026-10-03T04:30:49.993Z sha 771840e :: blocked before merge. :: none

@steipete
steipete force-pushed the deslop/l320-simplify-autoreply-routing-sessions-20261002 branch from e7f60a8 to 771840e Compare October 3, 2026 03:53
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui agents Agent runtime and tooling labels Oct 3, 2026
@steipete
steipete enabled auto-merge (squash) October 3, 2026 03:54
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 3, 2026
@steipete
steipete merged commit 6706f9d into main Oct 3, 2026
158 of 159 checks passed
@steipete
steipete deleted the deslop/l320-simplify-autoreply-routing-sessions-20261002 branch October 3, 2026 04:42
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
)

Simplify reply execution, command routing, session helpers, and audio-buffer ownership while preserving public configuration, wire shapes, persisted data, authorization, delivery custody, and cancellation behavior.

Render malformed archived read ranges as literal text in HTML exports, and restore sidebar rows when Escape clears search. Complete audio-pipeline caller migration, browser JSON-coercion resolution, export ownership, lint, and shrink-only assertion baselines discovered by hosted CI.

Validated with 278 focused tests, UI build, zero cycles in both architecture checks, targeted lint/types/contracts, and independent review through P2. Exact-head hosted CI gates landing.
steipete added a commit that referenced this pull request Oct 15, 2026
Continue the same lane with direct owner resets instead of test-global
publications, inline the sole queue-wait scaffold, remove test-only delivery
getters, and share the immutable HTML tree and text extraction. Keep actual
login consent, interrupt authority, busy rechecks, dedupe, delivery recovery,
FIFO, transcript writes and ordinary shutdown settlement unchanged.

This follow-up removes 118 net production lines. Full branch: +341/-598,
257 net production lines removed; tests/support +84/-230, 146 net removed.
Largest-file, sole-caller, dead-export, option and compatibility sweeps found
no further sound cut without removing retained behavior or moving code.
Phase E session memory and its tests are untouched. No config, schema,
durability, retention, permission, protocol or dependency changes.

Best-effort tradeoffs accepted

- Command descriptors no longer manufacture absent optional own-undefined
  properties. The private typed builder dates to #117143, with later work
  in #163997; no production enumeration consumer exists. Property reads,
  supplied fields, defaults and JSON behavior remain unchanged.
- HTML entries are immutable for the lifetime of an export viewer. Build
  its tree/index once; external mutation of this private snapshot is not
  supported. Keep the iterative long-session fix from #151029.

Evidence

Fresh isolated full-branch review is scoped-clean through P2. Changed lint,
format, core types, messaging/root-tooling test types, line cap and runtime
cycles pass (0 runtime value cycles). The initial test-type invocation used
an invalid canonical graph selector; the corrected supported commands pass.
No new production runtime import edges; prior zero-cycle Madge proof applies.

Focused proof passes: 15 files/318 tests across four shards, 1629.71s total
including 382.56s worker preparation. Final-outcome/HTML: 4 files/45 tests;
ingress retry: 1 file/6 tests; required lint-suppressions: 1 file/3 tests;
auto-reply owners: 9 files/264 tests. Consent fixtures emitted host-broker
metadata-write warnings; all assertions passed. All proof used isolated
HOME/OpenClaw/XDG state, never real user state.

Earlier memory-window and background-permission timeouts remain unresolved;
their optional owner hunks were dropped, not claimed fixed. Broad changed
check remains incomplete, including the baseline-reproduced env inventory
455/454 finding. No tests, timeouts, retries, skips or budgets were weakened.
Below-500 branch-only handoff; no PR or hosted CI is claimed.
steipete added a commit that referenced this pull request Oct 15, 2026
…173047)

* refactor(auto-reply): consolidate delivery preparation

Share aggregate collect/overflow adoption, transcript settlement and reply
sanitization. Reuse ACP account preparation, keep fixed export colors with
their CSS owner, and remove redundant runtime/cache checks. Preserve live
authorization, FIFO, consume-before-ack and ordinary write settlement.

Production: +307/-446, net 139 lines removed. Tests: +37/-83, net 46 removed.
The optional session rollover and session-event assertion cleanups were dropped
after unresolved memory-hook/background-permission proof. Their owners and the
standalone session-memory backend/tests are unchanged.

Best-effort tradeoffs accepted

- Intl constructor hot replacement after cache fill: #148648 added synthetic replacement/recovery coverage, not an incident fix; normal processes keep Intl stable. The measured formatter cache and native fallback stay; replacement takes effect after restart.
- Media application failure clearing a successful import: #154864 extracted this path, without a module-reload incident. ESM code is process-stable and the lazy loader already evicts rejected loads; raw-content fallback remains and successful imports are reused.
- Link application failure clearing a successful import: same #154864 provenance and canonical eviction owner. A successful ESM module is reused; raw-content fallback and AbortError propagation remain.
- Collect-source reinsertion after a preparation failure: #103695 predates #172080's consume-before-ack cutover. Unaccepted inputs remain queued and accepted inputs must not replay; unexplained internal queue mutation is no longer repaired here, while durable ingress retains pre-acceptance retry.
- A source abort between consecutive synchronous prepared checks: the earlier #100123 TUI fixes remain, including their real #89059/#90012 behavior. The canonical prepared assertion checks every source; Stop membership filtering and aggregate cancellation still protect actual awaits.
- Duplicate ACP post-resolution assertion: #159084 introduced async metadata ownership. Resolution still receives its owner assertion and the caller keeps the final post-await check; the private wrapper and its earlier duplicate check are gone.
- Mutation of constructor metadata bags: #121995 retained forwarding getters, but the sole production constructor call at reply-turn-admission.ts:524 supplies a fresh value literal. Those values are captured once; live session/agent/result accessors remain. The review's hypothetical retained/getter-valued constructor caller does not exist and is not a shipped SDK contract.

Evidence

Final format, changed lint, core production types, messaging test types,
line-cap and runtime cycles pass. Madge reports zero cycles; all follow-up
import specifiers are unchanged. All non-whitespace export CSS and all 40 fixed
declarations match the pinned generated stylesheet. Independent full-candidate
review completed with one source-disproved speculative P2; no accepted finding.
Completed focused selections: initial unit-fast 4 files/40 tests, HTML 3 files/29
tests, and final lint-suppressions 1 file/3 tests. ACP default-account and delivery
assertions, plus capture/hook/callback-settlement assertions, passed individually;
interrupted infra selections and remaining owner suites are incomplete.

Unresolved local failures: the retiring memory-window case timed out at 125461ms,
and the allowed background-permission completion case at 120332ms (both existing
120000ms limits). Related optional owner hunks were dropped, not claimed fixed.
An unchanged-session-owner replay was inconclusive; no main/load attribution.
No tests, timeouts, retries or skips were weakened.

Broad check-changed is incomplete. Its env inventory reported 455 against 454;
the same count was reproduced from original base 9e3e16c and recorded main
a065e6a, without patch-added env names or a budget edit. No hosted PR CI is
claimed: below-500 branch-only handoff for coordinator bundling.

* refactor(auto-reply): remove test-only runtime plumbing

Continue the same lane with direct owner resets instead of test-global
publications, inline the sole queue-wait scaffold, remove test-only delivery
getters, and share the immutable HTML tree and text extraction. Keep actual
login consent, interrupt authority, busy rechecks, dedupe, delivery recovery,
FIFO, transcript writes and ordinary shutdown settlement unchanged.

This follow-up removes 118 net production lines. Full branch: +341/-598,
257 net production lines removed; tests/support +84/-230, 146 net removed.
Largest-file, sole-caller, dead-export, option and compatibility sweeps found
no further sound cut without removing retained behavior or moving code.
Phase E session memory and its tests are untouched. No config, schema,
durability, retention, permission, protocol or dependency changes.

Best-effort tradeoffs accepted

- Command descriptors no longer manufacture absent optional own-undefined
  properties. The private typed builder dates to #117143, with later work
  in #163997; no production enumeration consumer exists. Property reads,
  supplied fields, defaults and JSON behavior remain unchanged.
- HTML entries are immutable for the lifetime of an export viewer. Build
  its tree/index once; external mutation of this private snapshot is not
  supported. Keep the iterative long-session fix from #151029.

Evidence

Fresh isolated full-branch review is scoped-clean through P2. Changed lint,
format, core types, messaging/root-tooling test types, line cap and runtime
cycles pass (0 runtime value cycles). The initial test-type invocation used
an invalid canonical graph selector; the corrected supported commands pass.
No new production runtime import edges; prior zero-cycle Madge proof applies.

Focused proof passes: 15 files/318 tests across four shards, 1629.71s total
including 382.56s worker preparation. Final-outcome/HTML: 4 files/45 tests;
ingress retry: 1 file/6 tests; required lint-suppressions: 1 file/3 tests;
auto-reply owners: 9 files/264 tests. Consent fixtures emitted host-broker
metadata-write warnings; all assertions passed. All proof used isolated
HOME/OpenClaw/XDG state, never real user state.

Earlier memory-window and background-permission timeouts remain unresolved;
their optional owner hunks were dropped, not claimed fixed. Broad changed
check remains incomplete, including the baseline-reproduced env inventory
455/454 finding. No tests, timeouts, retries, skips or budgets were weakened.
Below-500 branch-only handoff; no PR or hosted CI is claimed.

* refactor(channels): consolidate secondary transport plumbing

Use existing SDK setup and sleep owners, reuse parsed Tlon list items,
consolidate LINE callback validation and Teams sender selection, replace
iMessage's parallel cache indices, and remove redundant QA snapshots.
Preserve account, security, conversation, transport and settlement contracts.

Best-effort tradeoffs accepted:
- Feishu identity published before successor route registration during an old
  webhook drain may be cleared until refresh/restart. Available #48588 evidence
  only forces that identity interleaving in a test, with no cited human report;
  registered successors, signed ingress and response settlement remain protected.
- QA senders that mutate already-sanitized internal tool records no longer
  receive independent deep-snapshot comparison. Native records only append;
  the mutation tests from #114910 monkeypatch a sender. Duplicate final
  suppression and pre-await tool-array capture remain.
- Retired Bot Framework revoked proxies no longer trigger proactive resend.
  The historical #27189 defect belonged to the SDK replaced in #51808;
  current Teams ActivityContext is not a revocable proxy. Unexpected errors
  now follow the ordinary delivery-error path, without duplicate fallback.
- The bounded self-chat cache uses linear lookup instead of synchronized
  indices. #161967 establishes no measured lookup-performance requirement;
  existing TTL, cap, timestamp, scope and hash matching remain unchanged.

No config, protocol, dependency, schema, durability, retention, permission or
public SDK contract changes. Phase E memory backend is untouched.

Net production: 246 lines removed (83 added, 329 deleted), excluding tests,
support and inventories. Fresh review through P2 is clean; production/test
extension types and both cycle checks pass (zero cycles). X focused suites
pass 31 tests; native Buzz baseline/current protocol probes preserve signed
discovery, cancellation and notification-driven retry. Other direct owner
probes cover Tlon, self-chat caching, LINE limits and Mattermost setup.

Local proof gaps: SDK declaration preparation timed out before lint; the
remaining owner suites produced no assertions during loaded-host startup;
full check-changed was classified but not run. The suppression test has
unrelated UI-only allowlist drift inherited from the base. No new suppression,
timeout increase, retry, skip or baseline expansion.

* refactor(channels): simplify account-scoped transport owners

Use the existing account registry as Twitch's only account owner, fold the
private Teams store selector into its only caller, share QA message sending,
and remove redundant Feishu table/cache and mobile expiry work. Convert
replacement table-cell Markdown before deleting its existing content.

Best-effort tradeoffs accepted:
- Feishu optional bot-name failures use one 60-second account cooldown, not
  ten failures plus an hour-long circuit. #89783 documents feature proof,
  not a human incident needing that circuit. Names recover next minute.
- Unsupported runtimes without Intl.Segmenter now fail clearly; supported
  Node/current Bun preserve #96587's real grapheme/emoji repair.
- Malformed duplicate Feishu block IDs retain source/current-table order,
  not redundant map/sort or first-match order. Valid provider trees retain
  the tree reconstruction and table-width behavior from #40524.
- LINE cache eviction assumes ordinary wall-clock order. #132108's real
  account identity fix remains; backward clock jumps may evict another
  display-name entry, which is refetched normally.
- iMessage/Zalouser internal expiries trust Date.now plus constant TTLs.
  Direct commits 5269924/becd45325bc and 743d537 only test NaN,
  Infinity or year-275760 clocks, not human reports. Monkeypatched invalid
  clocks may keep cached verdicts/metadata until restart.
- Zalo's duplicate expiry preflight is gone; the shared hosted-media owner
  still rejects before download. f91ddef added only synthetic clock
  handling; an invalid clock now receives that owner's generic error.
- FaceTime cancels synchronous drain timers rather than fencing them with
  generations. #119291 cites no stale-timer incident; barge-in, carrier
  authority, playback timing and shutdown settlement remain.
- Private Twitch managers serve one registered account, not arbitrary
  additional username/channel pairs. #1612 introduced unused inner maps;
  production managers already belong to one account. Real startup
  cancellation and connection sharing from #128909 remain.

No config, protocol, dependency, schema, retention, permission or public SDK
changes. Phase E memory is untouched. The attempted vendor-type consolidation
was fully dropped because the pinned ZCA package cannot expose its public
types under NodeNext without an approval-gated dependency/configuration fix.

Reopened pass: 183 additional net production lines removed; branch total429
(176 added/605 deleted), excluding tests/support/generated/declarations.
Production/test extension types, runtime/Madge zero-cycle checks, formatting
and actual Tlon/long-sleep owner probes pass. Fresh P2 review has three
source-disproved findings and no accepted/actionable finding. Two mocked
constructor lint errors were mechanically fixed and their narrow guard passes.
Owner suites remained startup-bound and were stopped before assertions;
the docx regression/control remains unproved. Suppression suite retains only
the known base UI allowlist drift. Full package-aware lint/check-changed and
exact bundle-head CI remain for coordinator bundling. No structural PR.

* test: repair wave-5 bundle integration checks
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…penclaw#173047)

* refactor(auto-reply): consolidate delivery preparation

Share aggregate collect/overflow adoption, transcript settlement and reply
sanitization. Reuse ACP account preparation, keep fixed export colors with
their CSS owner, and remove redundant runtime/cache checks. Preserve live
authorization, FIFO, consume-before-ack and ordinary write settlement.

Production: +307/-446, net 139 lines removed. Tests: +37/-83, net 46 removed.
The optional session rollover and session-event assertion cleanups were dropped
after unresolved memory-hook/background-permission proof. Their owners and the
standalone session-memory backend/tests are unchanged.

Best-effort tradeoffs accepted

- Intl constructor hot replacement after cache fill: openclaw#148648 added synthetic replacement/recovery coverage, not an incident fix; normal processes keep Intl stable. The measured formatter cache and native fallback stay; replacement takes effect after restart.
- Media application failure clearing a successful import: openclaw#154864 extracted this path, without a module-reload incident. ESM code is process-stable and the lazy loader already evicts rejected loads; raw-content fallback remains and successful imports are reused.
- Link application failure clearing a successful import: same openclaw#154864 provenance and canonical eviction owner. A successful ESM module is reused; raw-content fallback and AbortError propagation remain.
- Collect-source reinsertion after a preparation failure: openclaw#103695 predates openclaw#172080's consume-before-ack cutover. Unaccepted inputs remain queued and accepted inputs must not replay; unexplained internal queue mutation is no longer repaired here, while durable ingress retains pre-acceptance retry.
- A source abort between consecutive synchronous prepared checks: the earlier openclaw#100123 TUI fixes remain, including their real openclaw#89059/openclaw#90012 behavior. The canonical prepared assertion checks every source; Stop membership filtering and aggregate cancellation still protect actual awaits.
- Duplicate ACP post-resolution assertion: openclaw#159084 introduced async metadata ownership. Resolution still receives its owner assertion and the caller keeps the final post-await check; the private wrapper and its earlier duplicate check are gone.
- Mutation of constructor metadata bags: openclaw#121995 retained forwarding getters, but the sole production constructor call at reply-turn-admission.ts:524 supplies a fresh value literal. Those values are captured once; live session/agent/result accessors remain. The review's hypothetical retained/getter-valued constructor caller does not exist and is not a shipped SDK contract.

Evidence

Final format, changed lint, core production types, messaging test types,
line-cap and runtime cycles pass. Madge reports zero cycles; all follow-up
import specifiers are unchanged. All non-whitespace export CSS and all 40 fixed
declarations match the pinned generated stylesheet. Independent full-candidate
review completed with one source-disproved speculative P2; no accepted finding.
Completed focused selections: initial unit-fast 4 files/40 tests, HTML 3 files/29
tests, and final lint-suppressions 1 file/3 tests. ACP default-account and delivery
assertions, plus capture/hook/callback-settlement assertions, passed individually;
interrupted infra selections and remaining owner suites are incomplete.

Unresolved local failures: the retiring memory-window case timed out at 125461ms,
and the allowed background-permission completion case at 120332ms (both existing
120000ms limits). Related optional owner hunks were dropped, not claimed fixed.
An unchanged-session-owner replay was inconclusive; no main/load attribution.
No tests, timeouts, retries or skips were weakened.

Broad check-changed is incomplete. Its env inventory reported 455 against 454;
the same count was reproduced from original base d6898f3 and recorded main
51164a1, without patch-added env names or a budget edit. No hosted PR CI is
claimed: below-500 branch-only handoff for coordinator bundling.

* refactor(auto-reply): remove test-only runtime plumbing

Continue the same lane with direct owner resets instead of test-global
publications, inline the sole queue-wait scaffold, remove test-only delivery
getters, and share the immutable HTML tree and text extraction. Keep actual
login consent, interrupt authority, busy rechecks, dedupe, delivery recovery,
FIFO, transcript writes and ordinary shutdown settlement unchanged.

This follow-up removes 118 net production lines. Full branch: +341/-598,
257 net production lines removed; tests/support +84/-230, 146 net removed.
Largest-file, sole-caller, dead-export, option and compatibility sweeps found
no further sound cut without removing retained behavior or moving code.
Phase E session memory and its tests are untouched. No config, schema,
durability, retention, permission, protocol or dependency changes.

Best-effort tradeoffs accepted

- Command descriptors no longer manufacture absent optional own-undefined
  properties. The private typed builder dates to openclaw#117143, with later work
  in openclaw#163997; no production enumeration consumer exists. Property reads,
  supplied fields, defaults and JSON behavior remain unchanged.
- HTML entries are immutable for the lifetime of an export viewer. Build
  its tree/index once; external mutation of this private snapshot is not
  supported. Keep the iterative long-session fix from openclaw#151029.

Evidence

Fresh isolated full-branch review is scoped-clean through P2. Changed lint,
format, core types, messaging/root-tooling test types, line cap and runtime
cycles pass (0 runtime value cycles). The initial test-type invocation used
an invalid canonical graph selector; the corrected supported commands pass.
No new production runtime import edges; prior zero-cycle Madge proof applies.

Focused proof passes: 15 files/318 tests across four shards, 1629.71s total
including 382.56s worker preparation. Final-outcome/HTML: 4 files/45 tests;
ingress retry: 1 file/6 tests; required lint-suppressions: 1 file/3 tests;
auto-reply owners: 9 files/264 tests. Consent fixtures emitted host-broker
metadata-write warnings; all assertions passed. All proof used isolated
HOME/OpenClaw/XDG state, never real user state.

Earlier memory-window and background-permission timeouts remain unresolved;
their optional owner hunks were dropped, not claimed fixed. Broad changed
check remains incomplete, including the baseline-reproduced env inventory
455/454 finding. No tests, timeouts, retries, skips or budgets were weakened.
Below-500 branch-only handoff; no PR or hosted CI is claimed.

* refactor(channels): consolidate secondary transport plumbing

Use existing SDK setup and sleep owners, reuse parsed Tlon list items,
consolidate LINE callback validation and Teams sender selection, replace
iMessage's parallel cache indices, and remove redundant QA snapshots.
Preserve account, security, conversation, transport and settlement contracts.

Best-effort tradeoffs accepted:
- Feishu identity published before successor route registration during an old
  webhook drain may be cleared until refresh/restart. Available openclaw#48588 evidence
  only forces that identity interleaving in a test, with no cited human report;
  registered successors, signed ingress and response settlement remain protected.
- QA senders that mutate already-sanitized internal tool records no longer
  receive independent deep-snapshot comparison. Native records only append;
  the mutation tests from openclaw#114910 monkeypatch a sender. Duplicate final
  suppression and pre-await tool-array capture remain.
- Retired Bot Framework revoked proxies no longer trigger proactive resend.
  The historical openclaw#27189 defect belonged to the SDK replaced in openclaw#51808;
  current Teams ActivityContext is not a revocable proxy. Unexpected errors
  now follow the ordinary delivery-error path, without duplicate fallback.
- The bounded self-chat cache uses linear lookup instead of synchronized
  indices. openclaw#161967 establishes no measured lookup-performance requirement;
  existing TTL, cap, timestamp, scope and hash matching remain unchanged.

No config, protocol, dependency, schema, durability, retention, permission or
public SDK contract changes. Phase E memory backend is untouched.

Net production: 246 lines removed (83 added, 329 deleted), excluding tests,
support and inventories. Fresh review through P2 is clean; production/test
extension types and both cycle checks pass (zero cycles). X focused suites
pass 31 tests; native Buzz baseline/current protocol probes preserve signed
discovery, cancellation and notification-driven retry. Other direct owner
probes cover Tlon, self-chat caching, LINE limits and Mattermost setup.

Local proof gaps: SDK declaration preparation timed out before lint; the
remaining owner suites produced no assertions during loaded-host startup;
full check-changed was classified but not run. The suppression test has
unrelated UI-only allowlist drift inherited from the base. No new suppression,
timeout increase, retry, skip or baseline expansion.

* refactor(channels): simplify account-scoped transport owners

Use the existing account registry as Twitch's only account owner, fold the
private Teams store selector into its only caller, share QA message sending,
and remove redundant Feishu table/cache and mobile expiry work. Convert
replacement table-cell Markdown before deleting its existing content.

Best-effort tradeoffs accepted:
- Feishu optional bot-name failures use one 60-second account cooldown, not
  ten failures plus an hour-long circuit. openclaw#89783 documents feature proof,
  not a human incident needing that circuit. Names recover next minute.
- Unsupported runtimes without Intl.Segmenter now fail clearly; supported
  Node/current Bun preserve openclaw#96587's real grapheme/emoji repair.
- Malformed duplicate Feishu block IDs retain source/current-table order,
  not redundant map/sort or first-match order. Valid provider trees retain
  the tree reconstruction and table-width behavior from openclaw#40524.
- LINE cache eviction assumes ordinary wall-clock order. openclaw#132108's real
  account identity fix remains; backward clock jumps may evict another
  display-name entry, which is refetched normally.
- iMessage/Zalouser internal expiries trust Date.now plus constant TTLs.
  Direct commits 3bcf53d/233d19aff94 and 2bf2afc only test NaN,
  Infinity or year-275760 clocks, not human reports. Monkeypatched invalid
  clocks may keep cached verdicts/metadata until restart.
- Zalo's duplicate expiry preflight is gone; the shared hosted-media owner
  still rejects before download. 2512ef2 added only synthetic clock
  handling; an invalid clock now receives that owner's generic error.
- FaceTime cancels synchronous drain timers rather than fencing them with
  generations. openclaw#119291 cites no stale-timer incident; barge-in, carrier
  authority, playback timing and shutdown settlement remain.
- Private Twitch managers serve one registered account, not arbitrary
  additional username/channel pairs. openclaw#1612 introduced unused inner maps;
  production managers already belong to one account. Real startup
  cancellation and connection sharing from openclaw#128909 remain.

No config, protocol, dependency, schema, retention, permission or public SDK
changes. Phase E memory is untouched. The attempted vendor-type consolidation
was fully dropped because the pinned ZCA package cannot expose its public
types under NodeNext without an approval-gated dependency/configuration fix.

Reopened pass: 183 additional net production lines removed; branch total429
(176 added/605 deleted), excluding tests/support/generated/declarations.
Production/test extension types, runtime/Madge zero-cycle checks, formatting
and actual Tlon/long-sleep owner probes pass. Fresh P2 review has three
source-disproved findings and no accepted/actionable finding. Two mocked
constructor lint errors were mechanically fixed and their narrow guard passes.
Owner suites remained startup-bound and were stopped before assertions;
the docx regression/control remains unproved. Suppression suite retains only
the known base UI allowlist drift. Full package-aware lint/check-changed and
exact bundle-head CI remain for coordinator bundling. No structural PR.

* test: repair wave-5 bundle integration checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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