Skip to content

refactor(auto-reply): split config dispatch pipeline - #113154

Merged
steipete merged 2 commits into
mainfrom
steipete/simplify-w3-dispatch-split
Jul 23, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/simplify-w3-dispatch-split

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

dispatchReplyFromConfigInner was the repository's most complex function: 2,821 lines with a branch score of 234, inside a 3,061-line file that required a max-lines exception. Its intertwined request preparation, routing, execution, and finalization made safe review and parallel maintenance unnecessarily difficult.

Why This Change Was Made

This is a behavior-preserving structural decomposition into named gather, delivery preparation, operation preparation, route selection, execution preparation, execution, and finalization phases. A single prepared-state object flows forward; mutable facts use live accessors so later callbacks and audit handling observe the same state without rediscovery or copied stale booleans.

The entry module is now 98 lines, every extracted production module is at or below 654 lines, and the obsolete max-lines baseline entry is removed. The +809 net line delta is explicit phase-state and module-boundary plumbing around the unchanged dispatch logic; no behavior, config, protocol, or persistence contract changed.

Collision note: #96095, #97649, and #83988 were open and updated within 48 hours when this work started. #96095 and #83988 overlap the final-delivery/TTS region; #97649 changes the ACP/hook routing region. This PR does not duplicate their semantic changes and will need semantic rebasing if one lands first. #109109 was also open but outside the 48-hour active window.

User Impact

No user-visible behavior changes. Maintainers get a reviewable dispatch pipeline with explicit ownership boundaries and no max-lines suppression.

Evidence

  • Local focused proof: dispatch-from-config.test.ts and final-outcome counts, 278/278 passing.
  • Blacksmith Testbox run 30043641106: all src/auto-reply suites (4,456 tests), Discord reply delivery (18), and Slack outbound delivery (3) passed.
  • Blacksmith Testbox run 30044615333: scoped check:changed passed production/test typechecks, formatting, max-lines, lint, architecture guards, and import-cycle checks.
  • Codex autoreview (gpt-5.6-sol, xhigh): no findings; patch correctness confidence 0.91.
  • Test delta: 0 added / 0 removed; existing behavior suites provide parity proof.

@openclaw-barnacle openclaw-barnacle Bot added size: XL maintainer Maintainer-authored PR labels Jul 23, 2026
@steipete steipete self-assigned this Jul 23, 2026
@steipete
steipete marked this pull request as ready for review July 23, 2026 21:51
@steipete
steipete force-pushed the steipete/simplify-w3-dispatch-split branch from 3bca539 to 2f19e50 Compare July 23, 2026 22:07
@steipete
steipete merged commit 127b781 into main Jul 23, 2026
187 of 189 checks passed
@steipete
steipete deleted the steipete/simplify-w3-dispatch-split branch July 23, 2026 22:31
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 24, 2026
* refactor(auto-reply): split config dispatch pipeline

* refactor(auto-reply): keep phase result types private
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant