Skip to content

refactor(gateway): split agent runtime helpers#106544

Merged
steipete merged 2 commits into
mainfrom
codex/refactor-gateway-agent-runtime
Jul 13, 2026
Merged

refactor(gateway): split agent runtime helpers#106544
steipete merged 2 commits into
mainfrom
codex/refactor-gateway-agent-runtime

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #106503

What Problem This Solves

The gateway agent method mixed session-reset delivery, task ownership, and terminal run dispatch into one 4,168-line method module, making independent lifecycle paths difficult to review.

Why This Change Was Made

Moves reset handling, task tracking, and run dispatch into focused modules while leaving request orchestration in the handler. The original module drops from 4,168 to 3,485 lines; every new production TypeScript file remains below 500 lines. Control flow and lifecycle semantics remain unchanged.

User Impact

No user-visible behavior change. Maintainers get smaller owner-aligned gateway lifecycle modules.

Evidence

  • Blacksmith Testbox tbx_01kxe3nn9k106ex7wr5g4vd4ft
  • pnpm tsgo:core
  • pnpm test src/gateway/server-methods/agent.test.ts — 237 tests passed
  • pnpm exec oxfmt --check on all four touched files
  • Autoreview: clean, no actionable findings

AI assistance used for refactoring and review.

@steipete steipete self-assigned this Jul 13, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XL maintainer Maintainer-authored PR labels Jul 13, 2026
@steipete
steipete force-pushed the codex/refactor-gateway-agent-runtime branch from 1d78e61 to 8b29a41 Compare July 13, 2026 16:37
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification:

  • Blacksmith Testbox tbx_01kxe3nn9k106ex7wr5g4vd4ft: pnpm tsgo:core
  • Blacksmith Testbox tbx_01kxe3nn9k106ex7wr5g4vd4ft: pnpm test src/gateway/server-methods/agent.test.ts — 237 passed
  • CI dead-export fix: Blacksmith Testbox tbx_01kxe5xnjnjpdrf05fck229f4s passed pnpm tsgo:core and pnpm deadcode:exports
  • pnpm exec oxfmt --check on all four touched files; git diff --check
  • fresh autoreviews: clean after the refactor and after the CI fix
  • exact-head hosted CI: https://github.com/openclaw/openclaw/actions/runs/29268012534 — passed after rerunning one unrelated tooling shard failure
  • repo-native scripts/pr review-validate-artifacts 106544: passed

Known proof gaps: none for this behavior-preserving internal split.

@steipete
steipete merged commit 1c5e35f into main Jul 13, 2026
161 of 162 checks passed
@steipete
steipete deleted the codex/refactor-gateway-agent-runtime branch July 13, 2026 17:07
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

wm0018 pushed a commit to wm0018/openclaw that referenced this pull request Jul 14, 2026
* refactor(gateway): split agent runtime helpers

* fix(gateway): keep task status type internal
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 14, 2026
* refactor(gateway): split agent runtime helpers

* fix(gateway): keep task status type internal
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 size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant