Skip to content

Rebase fork on upstream #471 (RPC override) + #506/#480/#490 + shutdown hardening#4

Merged
axisrow merged 16 commits into
mainfrom
rebase-on-471
Jul 16, 2026
Merged

Rebase fork on upstream #471 (RPC override) + #506/#480/#490 + shutdown hardening#4
axisrow merged 16 commits into
mainfrom
rebase-on-471

Conversation

@axisrow

@axisrow axisrow commented Jul 16, 2026

Copy link
Copy Markdown
Owner

What

Replaces the fork's spawn--c override (PR #2, 1.0.6-fork.1) with upstream #471's RPC thread/start.config approach, while preserving the fork's generic shutdown hardening that openai#471 does not include. Plus merges openai#506, openai#480, openai#490.

Full rationale and layer breakdown: fork issue #3.

Why

openai#471 is broader/better than our spawn--c: per-thread RPC override (no broker respawn needed) + runtime-identity respawn (plugin/codex version) + broker-lock + broker-probe + model-catalog. PR #2 becomes redundant.

Contents (4 merges + 2 cherry-picks)

Verified (codex-cli 0.144.4, macOS)

Merge notes

Fork-internal only — no upstream PR.

Alexandre Martins and others added 16 commits July 10, 2026 10:05
A shared app-server broker outlives the Claude Code session that spawned it.
When the session exits without a clean teardown the broker is reparented to
init and stays listening forever, holding its `codex app-server` child open.
These accumulate: on one developer machine, 8 orphaned brokers and their
children held ~1.3 GB RSS, the oldest alive for 41 hours.

Shut the broker down after 15 minutes with no connected clients. Foreground
and background jobs hold a connection for their whole lifetime, so an active
job always keeps its broker alive; `CODEX_COMPANION_BROKER_IDLE_TIMEOUT_MS`
overrides the window and `0` disables the timer. `ensureBrokerSession()`
already probes the endpoint and respawns when it finds none, so an
idle-exited broker is transparently recreated on the next call.

Also close the listener before awaiting async child cleanup, and reject
connections that arrive during shutdown, so a reconnect cannot slip into the
shutdown window and inherit a closing app-server client.

Tests run with a 2s idle window so the suite does not leave detached helpers.
… (RPC thread/start.config override + broker-lock/probe/model-catalog + runtime-identity respawn)
…ords (openai#481 observability)

# Conflicts:
#	plugins/codex/scripts/lib/codex.mjs
#	tests/fake-codex-fixture.mjs
…favor of openai#471 reconstruction

# Conflicts:
#	.claude-plugin/marketplace.json
#	README.md
#	plugins/codex/.claude-plugin/plugin.json
#	plugins/codex/commands/adversarial-review.md
#	plugins/codex/commands/review.md
#	plugins/codex/scripts/lib/app-server.mjs
#	plugins/codex/scripts/lib/broker-lifecycle.mjs
#	tests/commands.test.mjs
#	tests/runtime.test.mjs
…#471's danger-full-access)

openai#471 (commit a6e501a) mapped --write to danger-full-access. Under
approvalPolicy: never that removes all containment — --write silently
grants full host-filesystem authority. Adversarial review flagged it as
a privilege expansion (confidence 0.99). Reverting to workspace-write as
in upstream main; asked the openai#471 author for the intent behind the change
(openai#471 issuecomment-4991428428).
@axisrow
axisrow merged commit 15f6c0d into main Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants