refactor(codex): unify protocol artifact staging#104948
Merged
Merged
Conversation
vincentkoc
marked this pull request as ready for review
July 12, 2026 04:09
Member
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 12, 2026
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.
Related: #104871
What Problem This Solves
Codex app-server protocol refreshes staged the same generated tree twice: one recursive pass copied TypeScript and JSON files, then another recursive pass reopened every TypeScript file to normalize NodeNext imports. That duplicated traversal and split one artifact-staging invariant across helpers.
Why This Change Was Made
Replace the two passes with one focused internal staging module. JSON bytes are copied unchanged, TypeScript is normalized while it is staged, unsupported files stay ignored, and the existing formatter still runs only after staging completes.
The upstream contract was checked directly against the pinned Codex source:
codex-rs/app-server-protocol/src/bin/export.rs,codex-rs/app-server-protocol/src/export.rs,codex-rs/cli/src/main.rs, and the workspace version incodex-rs/Cargo.toml.User Impact
No user-visible or protocol behavior changes. Maintainers and coding agents get one smaller, directly testable artifact-staging boundary for generated protocol refreshes.
Evidence
pnpm test:serial test/scripts/codex-app-server-protocol-source.test.tson Blacksmith Testbox: 17 tests passed.OPENCLAW_CODEX_REPO=/tmp/openai-codex-rust-v0.144.1 pnpm codex-app-server:protocol:checkon Testboxtbx_01kxa7eaqw1dmsadagevpnamqb: the real pinned Rust exporter regenerated and verified 671 files successfully.pnpm check:changedon the same Testbox: passed.