Skip to content

refactor(gateway): split session handlers - #107677

Merged
steipete merged 5 commits into
mainfrom
codex/refactor-gateway-sessions
Jul 14, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/refactor-gateway-sessions

Conversation

@steipete

@steipete steipete commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The gateway session RPC surface had grown into one nearly 4,000-line module spanning unrelated read, lifecycle, messaging, compaction, and mutation responsibilities. That made ownership and review difficult and left the file grandfathered above the repository max-lines limit.

Why This Change Was Made

Split the handler implementation into responsibility-focused modules while keeping sessions.ts as the small public composition point. Preserve the existing handler registry and behavior, extract only the model-backed compaction request builder, and retarget the session accessor/transcript boundary ratchets to every new child module.

The final commit also restores one missing trailing comma in src/auto-reply/reply/reply-config-runtime-mode.ts. That malformed file was already on main from #107678 and made every new exact-head formatter cohort fail; the repair is formatting-only and isolated from the session refactor.

No protocol, config, storage, or user-visible behavior changes.

User Impact

No user-visible change. Maintainers get smaller review surfaces, explicit ownership boundaries, and normal max-lines enforcement for the session gateway methods.

Evidence

  • Focused gateway session suite: 27 test files, 405 tests passed on Blacksmith Testbox.
  • Boundary fixture suite: 2 files, 42 tests passed on Blacksmith Testbox.
  • Core and core-test TypeScript checks passed; gateway lint passed for the split modules.
  • Max-lines ratchet passed with the stale sessions.ts baseline removed.
  • Session accessor and transcript-reader boundary guards passed after retargeting.
  • oxfmt --check passed for all changed TypeScript files and the current-main formatter repair.
  • Exact-head hosted CI: https://github.com/openclaw/openclaw/actions/runs/29353872927
  • Structured Codex autoreview: no accepted/actionable findings.

AI-assisted. I reviewed the handler boundaries, registry parity, compaction extraction, guard retargeting, exact-set fixtures, and formatter repair and understand the resulting code.

@steipete steipete self-assigned this Jul 14, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Jul 14, 2026
@steipete
steipete force-pushed the codex/refactor-gateway-sessions branch from 53508bd to 0e2cbed Compare July 14, 2026 17:27
@steipete
steipete merged commit 0b409a0 into main Jul 14, 2026
110 checks passed
@steipete
steipete deleted the codex/refactor-gateway-sessions branch July 14, 2026 17:41
@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 15, 2026
* refactor(gateway): split session handlers

* chore(gateway): drop obsolete max-lines suppression

* test(gateway): preserve session boundary ratchets

* test(gateway): update session boundary fixtures

* style(auto-reply): restore formatter compliance
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* refactor(gateway): split session handlers

* chore(gateway): drop obsolete max-lines suppression

* test(gateway): preserve session boundary ratchets

* test(gateway): update session boundary fixtures

* style(auto-reply): restore formatter compliance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant