Skip to content

refactor(codex): unify protocol artifact staging#104948

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/codex-protocol-generation-pipeline
Jul 12, 2026
Merged

refactor(codex): unify protocol artifact staging#104948
vincentkoc merged 1 commit into
mainfrom
refactor/codex-protocol-generation-pipeline

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

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 in codex-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.ts on Blacksmith Testbox: 17 tests passed.
  • OPENCLAW_CODEX_REPO=/tmp/openai-codex-rust-v0.144.1 pnpm codex-app-server:protocol:check on Testbox tbx_01kxa7eaqw1dmsadagevpnamqb: the real pinned Rust exporter regenerated and verified 671 files successfully.
  • pnpm check:changed on the same Testbox: passed.
  • Fresh structured autoreview: clean, 0.96 confidence.
  • Production code is net -4 lines.
  • Contract audit: no generated protocol/model/schema, config, Plugin SDK, CLI option, package, or environment surface changed.

@vincentkoc vincentkoc self-assigned this Jul 12, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Jul 12, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 12, 2026 04:09
@vincentkoc
vincentkoc merged commit ef13c2f into main Jul 12, 2026
80 of 83 checks passed
@vincentkoc
vincentkoc deleted the refactor/codex-protocol-generation-pipeline branch July 12, 2026 04:09
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR scripts Repository scripts size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant