Skip to content

refactor(codex): split app-server thread lifecycle - #108414

Merged
steipete merged 2 commits into
mainfrom
codex/refactor-codex-thread-lifecycle
Jul 15, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/refactor-codex-thread-lifecycle

Conversation

@steipete

@steipete steipete commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Codex app-server thread lifecycle lived in one 3,219-line module. That made ownership, review, and focused maintenance difficult, and required a max-lines suppression.

Why This Change Was Made

Split lifecycle orchestration, request I/O, supervision, request builders, binding policy, context-engine binding, fingerprints, model selection, prompts, timing, turn parameters, errors, and shared types into focused modules. Keep thread-lifecycle.ts as the stable public facade, preserve behavior, and remove the obsolete max-lines baseline entry.

Direct Codex contract check covered thread start/resume/read/fork/archive/inject-items, config reads, and MCP status handling in codex-rs/app-server-protocol and codex-rs/app-server at upstream Codex 38b064c31b1f7464b281006316ec878ed23fea77.

AI-assisted: yes. Maintainer-directed refactor. The implementation and proof were reviewed before submission.

User Impact

No user-visible behavior change. Developers get smaller owner-focused modules, a stable import surface, and no grandfathered line-count exemption for this lifecycle.

Evidence

  • node scripts/run-vitest.mjs extensions/codex/src/app-server/thread-lifecycle.test.ts: 109 tests passed on the landed PR head.
  • Binding, user MCP, and schema contract focused lane: 80 tests passed.
  • Deadcode unused-export guard: 0 entries after keeping split-local aliases private.
  • Blacksmith changed gate: extension production/test typechecks, extension/script lint, format, max-lines ratchet, plugin boundaries, database-first guard, and import-cycle guard passed.
  • Exact-head hosted CI: 62/62 jobs completed with no failures.
  • Final autoreview: clean, no accepted/actionable findings (0.99 confidence).

@steipete
steipete force-pushed the codex/refactor-codex-thread-lifecycle branch from 2da5727 to 23d0fef Compare July 15, 2026 18:13
@steipete
steipete merged commit b4b6afa into main Jul 15, 2026
107 checks passed
@steipete
steipete deleted the codex/refactor-codex-thread-lifecycle branch July 15, 2026 18:23
@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 16, 2026
* refactor(codex): split thread lifecycle

* refactor(codex): keep lifecycle types internal
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* refactor(codex): split thread lifecycle

* refactor(codex): keep lifecycle types internal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant