Skip to content

release: v1.1.1 — broker idle self-terminate, test process leak, rm-alias-safe traps - #2

Merged
CBEPX merged 7 commits into
mainfrom
release/v1.1.1
Aug 27, 2026
Merged

release: v1.1.1 — broker idle self-terminate, test process leak, rm-alias-safe traps#2
CBEPX merged 7 commits into
mainfrom
release/v1.1.1

Conversation

@CBEPX

@CBEPX CBEPX commented Aug 27, 2026

Copy link
Copy Markdown
Owner

1.1.1 — 2026-08-28

Reviews: task gates (Claude), whole-branch review (Claude) + adversarial review (Codex gpt-5.6-sol) → 2 lifecycle races fixed (stale-pid teardown hazard, late clients during shutdown) → scoped re-review clean. Tests 145 → 150; live check: real broker exits after idle timeout.

🤖 Generated with Claude Code

HoneyTyagii and others added 7 commits July 8, 2026 22:38
…penai#450)

A shared/worktree broker records its owning sessionIds in broker.json and is torn down only once no owner remains. If a co-owning session disappears without running its SessionEnd hook (SIGKILL, OOM, crash, host reboot) or its teardown skips the entry on lock contention, its sessionId lingers forever and no future hook fires for it, orphaning the broker indefinitely.

Fix it broker-side: app-server-broker.mjs now self-terminates after an idle timeout with no connected client. This is platform-independent, needs no PID/liveness signal, and covers the abnormal-exit orphan, the dead-co-owner orphan, and the lock-contention skip in one mechanism (see openai#108, openai#380, openai#450).

The timeout is configurable via --idle-timeout <ms> or CODEX_COMPANION_BROKER_IDLE_TIMEOUT_MS (default 30m); a value <= 0 disables it. The timer arms on listen and whenever the last client disconnects, and disarms while a client is connected.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…t in tests; CI leak gate; command rm in traps

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d CI flakes

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…before teardown, refuse late clients during shutdown

The idle self-terminate from openai#457 unlinked the socket and pid file but left
broker.json behind, so a later SessionEnd loaded a dead record and signalled a
PID (and process group) the OS may have recycled. The broker now drops the
record when it still points at itself, and teardownBrokerSession proves the
recorded PID is this session's broker (ps command line contains
app-server-broker.mjs and the endpoint) before signalling it.

shutdown() also kept listening while it closed the app-server child: a client
accepted in that window got the broker-local initialize and then failed its
first RPC with "codex app-server client is closed". The listener is now closed
synchronously before the first await and late sockets are destroyed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@CBEPX
CBEPX merged commit 6672679 into main Aug 27, 2026
2 checks passed
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