refactor: split hot TypeScript modules and add LOC ratchet#105894
Merged
Conversation
Contributor
Author
|
Land-ready proof for head
The head was rebased without conflicts onto |
steipete
force-pushed
the
codex/refactor-hot-god-files
branch
from
July 13, 2026 02:49
2de96fe to
4edb697
Compare
Contributor
Author
|
Merged via squash.
|
This was referenced Jul 13, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 13, 2026
…105894) * refactor: split high-churn agent and chat modules * ci: enforce TypeScript LOC ratchet * ci: anchor LOC baseline updates to merge base * test: cover LOC ratchet check plans * chore: refresh TypeScript LOC baseline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #105825
AI-assisted change; implementation and review decisions were verified against the touched code paths and tests.
What Problem This Solves
Resolves a maintenance problem where the hottest gateway and agent modules combine separable concerns in files thousands of lines long, increasing conflict and review cost. It also closes the process gap where the repository's existing TypeScript file-size check was not part of normal checks or CI, allowing the oversized-file backlog to grow.
Why This Change Was Made
The change splits chat history/display/routing/telemetry helpers, decomposes embedded-attempt setup/stream/finalize phases, and separates OpenAI Responses from Completions behind the stable transport facade. It also adds a current-size baseline and a downward-only 500-line ratchet to normal checks and CI, including base-ref protection against raising the baseline in the same PR or push.
session-accessor.sqlite.tsremains unchanged because it is cohesive and low churn.User Impact
No user-visible runtime or public API behavior changes. Maintainers get smaller ownership surfaces, lower merge-conflict pressure, and automated prevention of new or growing oversized TypeScript files.
Evidence
run_5fa5981c9a25: fullpnpm check:changedandpnpm buildpassed, including formatting, production/test/scripts typechecks, full core lint, SDK API/surface guards, import-cycle guards, and the production bundle.run_db9151737503:test/scripts/changed-lanes.test.tspassed 99/99 after adding LOC-plan expectations.check:loc, ninecheck-ts-max-loctests, and scripts typecheck passed on Testbox.node scripts/check-ts-max-loc.tsandgit diff --checkpass. Exact-head GitHub CI is the final landing gate.