Skip to content

fix(codex): avoid shutdown warnings after live updates - #106418

Merged
steipete merged 1 commit into
mainfrom
fix/codex-shutdown-live-build
Jul 13, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/codex-shutdown-live-build

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where operators applying live builds could see Codex harness shutdown warnings because the running Gateway tried to load a content-hashed client chunk that the new build had replaced.

Why This Change Was Made

The Codex harness now calls a preloaded, process-global disposer. The lazy shared-client runtime registers the real cleanup callback only when loaded, preserving cold-start behavior while keeping teardown callable after the on-disk dist tree changes.

User Impact

Gateway restarts after live builds can close Codex app-server clients without a stale-chunk ERR_MODULE_NOT_FOUND warning. No user-facing API or configuration changes.

Evidence

  • Repeated live restart logs reproduced Codex agent harness dispose hook failed with missing shared-client-*.js chunks.
  • Blacksmith Testbox: pnpm test extensions/codex/harness.test.ts — 25 tests passed.
  • Regression test verifies harness disposal uses the preloaded process-global callback.
  • Upstream Codex confirms stdio EOF is the graceful shutdown signal and bounded shutdown is the intended client lifecycle.
  • Autoreview: clean, no accepted/actionable findings.

@steipete steipete self-assigned this Jul 13, 2026
@steipete
steipete merged commit 0ff2658 into main Jul 13, 2026
174 of 180 checks passed
@steipete
steipete deleted the fix/codex-shutdown-live-build branch July 13, 2026 13:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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