Skip to content

refactor(imessage): deslop imessage - #161967

Merged
steipete merged 1 commit into
mainfrom
deslop/l232-imessage
Sep 30, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/l232-imessage

Conversation

@steipete

@steipete steipete commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The iMessage transport keeps redundant cache bookkeeping, repeated dispatch paths, and forwarding helpers after the recent channel cleanup passes.

User Impact

No user-visible change. Message encoding, delivery order, approval authorization, pairing, allowlists, configuration, manifests, and persisted formats stay unchanged.

Why This Change Was Made

  • Use one insertion-ordered Map for self-chat eviction order and retained-entry count, removing sparse-array compaction and duplicate counters while preserving TTL, timestamp skew and oldest-first eviction.
  • Share debounce dispatch/settlement and direct tool typing callbacks, and store rate-limit timestamp arrays directly.
  • Inline single-use approval payload/delivery hooks, remote-command error handling, and short-ID allocation into their owners; create binding-window completion with the SDK deferred helper.
  • Keep tapback aliases in one table and avoid re-normalizing admitted chat selectors and detected remote hosts.

Production reduction: 125 net lines. The existing cache memory-bound test was adapted to its retained Map; behavioral coverage and timing boundaries remain intact.

Evidence

  • Hosted job 109975856540: all 39 cache-lifecycle cases passed (6.232 seconds summed case time); the retained-memory case took 0.018 seconds. The shared 10-file/266-test shard took 118.98 seconds wall, not a standalone cache-file measurement.

  • Merged at reviewed head f20d382de61244e2754a45245f30a9f2c6680acb as 63b43fc09eb28e4b68278df6e5424a84730a2e3b. Hosted run 36741058971 failed build-artifacts because generated extensions/workboard/openclaw.plugin.json differed from committed bytes. The independent Workboard repair 3d0f45ee9cf4517a8e6f3b9bf048bafd2c508760 is already an ancestor of the squash merge. The failed run remains failed evidence; no rerun was dispatched.

  • Independent review: no actionable P0–P2 findings on the final source.

  • Linux Testbox: pnpm test:extensions:batch imessage,whatsapp,policy passed 3,132 tests; 8 skipped. The policy selector also included 21 unrelated files; all passed. The directory-selection bug is fixed separately in fix(test): keep extension batches inside requested directories #162009.

  • Final deferred-helper adjustment: 36 approval-flow tests passed, including durable replay; production and extension-test typechecks passed.

  • node scripts/run-vitest.mjs src/plugins/contracts src/infra/fs-safe-import-boundary.test.ts test/plugin-extension-import-boundary.test.ts test/test-helper-extension-import-boundary.test.ts: 1,178 tests passed on the final source.

  • Both scripts/check-madge-import-cycles.ts and scripts/check-import-cycles.ts: 0 cycles on the final source.

  • check-changed: source guards, formatting, package/boundary checks, and both typecheck lanes passed. The optional whole-tree Knip scans were interrupted for host load; hosted CI is the exact-head merge gate.

The full plugin run used the combined lane snapshot. Final focused checks used the unchanged candidate plus its SDK deferred-helper correction. After the Testbox expired and the AWS coordinator rejected authentication, remaining checks ran sequentially with nice -n 15 on the authorized local fallback.

Changed test cost: pnpm test extensions/imessage/src/monitor/cache-lifecycle.test.ts --maxWorkers=1 passed 39 tests in 32.104s wall on Linux; the adjusted memory-bound case took 12ms. Hosted CI timing is pending.

File coverage and recent merged-work audit

l232 iMessage production coverage

Every production TypeScript file over 200 lines in the lane's initial iMessage census is listed below, sorted by its original line count. All 23 files were read in full. Sizes describe the initial source, before the lane's reductions. Recent merged changes since September 18 were inspected by name to avoid repeating completed cuts.

Original lines File under extensions/imessage/src/ Coverage Simplification or reason for retaining the implementation
1660 monitor/monitor-provider.ts READ Simplified redundant debounce branching and duplicate typing callback construction; preserved monitor lifecycle and delivery ordering.
1103 send.ts READ No further sound simplification identified: transport selection, accepted receipts, and ambiguous-send recovery enforce distinct contracts.
1069 monitor/inbound-processing.ts READ Identity, access control, echo handling, and conversation routing have distinct responsibilities; retain their boundaries.
853 actions.ts READ Replaced repeated tapback alias assignments with one alias table while preserving action names and encodings.
689 monitor/sanitize-outbound.ts READ Layered security projections and fail-closed bounds enforce distinct hidden-content and role-marker contracts; no safe larger removal identified.
680 approval-handler.runtime.ts READ Inlined the single-use pending-payload builder at its presentation hook, removing its forwarding callback and repeated parameter types.
590 approval-polls.ts READ Persistent poll binding and current vote authority enforce distinct responsibilities; retain.
568 approval-reactions.ts READ Reaction correlation and approval settlement enforce distinct responsibilities; retain.
552 monitor-reply-cache.ts READ Inlined the single-use short-ID increment helper. Preserve persisted shape, chat/account ownership checks, and the named synchronous legacy-host matching contract.
527 channel.ts READ and Lead Inlined single-use approval payload preparation and delivered-payload registration into their existing hooks, preserving lazy loading and registration order.
504 client.ts READ Process settlement, UTF-8 byte framing, bridge recovery, and bounded shutdown have distinct contracts; no larger sound removal identified.
471 monitor/catchup.ts READ Retry ceilings, cursor rewind decisions, and malformed persisted-input normalization prevent distinct replay failures; retain.
458 actions.runtime.ts READ CLI and RPC transport encodings differ; retain their transport-specific adapters.
369 probe.ts READ Positive/negative cache lifetimes and independent CLI capability probes remain distinct; no larger sound removal identified.
311 accounts.ts READ Source deduplication, exclusive-database authorization, and nested streaming inheritance implement separate contracts; retain.
285 monitor/ingress.ts READ Priority controls, durable admission, and ordinary chat ordering require separate queue ownership; retain.
283 monitor/catchup-bridge.ts READ Raw source watermarks, capped dispatch watermarks, and retained dispatch payloads prevent distinct message-loss cases; retain.
267 approval-reaction-poll-targets.ts READ Persistence degradation and conversation identity merging remain necessary; no larger sound removal identified.
267 monitor/recovery-cursor.ts READ Published-host atomic-update fallback and consumed legacy cursor migrations have named compatibility contracts; retain.
253 approval-native.ts READ Route suppression and direct fallback preserve the approval delivery contract; retain.
253 setup-core.ts READ Managed install-path policy and sender-only allowlist parsing remain distinct; no substantial sound reduction identified.
249 approval-reaction-poller.ts READ GUID candidate matching, observed-conversation binding, and reaction encoding remain necessary; retain.
232 monitor/conversation-repair.ts READ Authoritative projection completeness and conflict checks protect conversation ownership; retain.

The supporting audit also read every assigned production TypeScript file at or below 200 lines. Implemented reductions in that group include removing repeated chat-selector normalization, removing redundant remote-host normalization after the canonical parser, inlining the remote command error wrapper, replacing the self-chat cache's sparse insertion array/counters/compaction with one retained-entry Map, removing placeholder binding-window resolver construction, and removing loop-rate timestamp wrappers. Existing TTL, capacity, timing, security, delivery, and persisted-state contracts remain the required validation targets.

The self-chat cache's existing structural memory-bound assertion was migrated to the retained Map-size invariant; its TTL and burst-eviction behavior cases were preserved. This coverage log records source inspection and selected changes, not test execution. Test results and measured cost belong to the lane's separate remote validation evidence.

Use an insertion-ordered map for self-chat eviction bookkeeping, share debounce and typing paths, and inline redundant approval and transport forwarding helpers. Reuse existing SDK and normalization owners while preserving message delivery, approval authorization, cache timing, and persisted formats.
@clawsweeper

clawsweeper Bot commented Sep 30, 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 channel: imessage Channel integration: imessage size: M labels Sep 30, 2026
@steipete
steipete enabled auto-merge (squash) September 30, 2026 16:04
@clawsweeper

clawsweeper Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 30, 2026, 12:07 PM ET / 16:07 UTC.

ClawSweeper review

What this changes

The iMessage plugin simplifies self-chat cache bookkeeping, message dispatch, approval hooks, action aliases, and remote transport helpers while preserving their existing interfaces.

Merge readiness

✅ Ready for maintainer review

Keep open: current main and the latest release do not contain this focused iMessage cleanup. The reviewed changes show no actionable introduced defect, and recent merged channel cleanup provides context for the work.

Priority: P3
Reviewed head: f20d382de61244e2754a45245f30a9f2c6680acb

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent internal cleanup with substantial reported validation and no actionable defect found in the reviewed patch.
Proof confidence 🌊 off-meta tidepool Not applicable: This trusted-author internal refactor changes iMessage cache, approval, and dispatch code; the PR body reports focused tests, and contributor live-proof admission does not apply. The changed cache is in-memory, and no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This trusted-author internal refactor changes iMessage cache, approval, and dispatch code; the PR body reports focused tests, and contributor live-proof admission does not apply. The changed cache is in-memory, and no stored-data contract changes.
Evidence reviewed 9 items Introduced change: The pinned PR delta replaces duplicate cache ordering state with an insertion-ordered Map and consolidates iMessage dispatch and approval helpers.
Current-main necessity: Fetched current main still uses the array, offset, and separate count that this PR removes.
Latest-release check: The latest release tag also retains the older cache bookkeeping; the PR head is not contained in a local release tag.
Findings None None.
Security None None.

How this fits together

The iMessage plugin receives Messages bridge events and agent replies, checks conversation and approval context, and sends messages or attachments. Its in-memory cache and rate limiter help prevent self-echoes and repeated processing.

flowchart LR
  A[Messages bridge events] --> C[iMessage plugin]
  B[Agent replies and approvals] --> C
  C --> D[Conversation and approval checks]
  D --> E[Debounce and self-chat cache]
  E --> F[Message and attachment delivery]
  F --> G[Messages recipients]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -125, Tests -1, Other 0. Total -126 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 12 104 229 -125
Tests 1 3 4 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 14 108 234 -126

Review metrics

None.

Technical review

Best possible solution:

Keep one iMessage cache-ordering path and one dispatch path, with existing echo, approval, and remote-host behavior protected by focused channel tests.

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

Not applicable: the PR claims a behavior-preserving refactor, not a reproducible current bug.

Is this the best way to solve the issue?

Yes: the simplification stays within existing iMessage plugin owners and adds no public API or persisted format.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3d0f45ee9cf4.

Labels

Label changes:

  • add P3: This is a behavior-preserving plugin cleanup with no reported user-facing defect.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P3: This is a behavior-preserving plugin cleanup with no reported user-facing defect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • joshavant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • colmbrogan: 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.

@steipete

Copy link
Copy Markdown
Contributor Author

Coordinator admin-land on exact head f20d382 under the campaign's pre-existing-failure exception.

CI run 36741058971's only failing job is build-artifacts: "Generated bundled plugin assets differ from the committed bytes: extensions/workboard/openclaw.plugin.json". That stale control-UI hash was introduced on main by #161943 and fixed there by 3d0f45e, after this PR's merge ref was created. This PR only touches extensions/imessage. Every other job passed, and auto-merge was armed by the lane worker.

@steipete
steipete merged commit 63b43fc into main Sep 30, 2026
162 of 165 checks passed
@steipete
steipete deleted the deslop/l232-imessage branch September 30, 2026 16:12
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
Use an insertion-ordered map for self-chat eviction bookkeeping, share debounce and typing paths, and inline redundant approval and transport forwarding helpers. Reuse existing SDK and normalization owners while preserving message delivery, approval authorization, cache timing, and persisted formats.
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

channel: imessage Channel integration: imessage size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant