Conversation
This was referenced Sep 9, 2026
ladydd
force-pushed
the
fix/reject-compaction-waiters-on-exit
branch
from
September 11, 2026 06:24
35ca9a1 to
a67f231
Compare
ladydd
added a commit
to ladydd/Lody
that referenced
this pull request
Sep 11, 2026
Pin acp-extension-codex to a67f231 (LodyAI/acp-extension-codex#38, rebased onto current adapter main / 5f0aab0) so compaction waiters reject when the Codex process exits. Other submodules stay on current main. Depends on adapter LodyAI#38. Do not ship a desktop release until that merge. Closes LodyAI#550
Author
|
Rebased onto current |
Turn waiters already reject on connection close. Compaction waiters were resolve-only, so /compact hangs forever if app-server dies after thread/compact/start, and the next prompt is already active. Reject compaction waiters on close/dispose, share the connection terminal error, and wait for start + completion together so a close before start returns cannot stall on the start RPC.
ladydd
force-pushed
the
fix/reject-compaction-waiters-on-exit
branch
from
September 12, 2026 16:20
a67f231 to
31c5ecc
Compare
ladydd
added a commit
to ladydd/Lody
that referenced
this pull request
Sep 12, 2026
Pin acp-extension-codex to a67f231 (LodyAI/acp-extension-codex#38, rebased onto current adapter main / 5f0aab0) so compaction waiters reject when the Codex process exits. Other submodules stay on current main. Depends on adapter LodyAI#38. Do not ship a desktop release until that merge. Closes LodyAI#550
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.
Problem / pressure
/compactwaits on athread/compactednotification. Turn waiters already reject when the Codex process exits (rejectAllPendingTurnCompletions); the comment there says the alternative is a forever hang, then every later prompt isA Codex prompt is already active. Compaction waiters were resolve-only Promises.If app-server dies after
thread/compact/startsucceeds, that notification never arrives. The ACP prompt stays occupied. Host Stop/session/canceldoes not finish it. The next prompt isalready active.This is not “
/compactis broken”: a healthy compact completes. Mid-turn process death already returns-32603in milliseconds. Compaction is the hole.This is also not the fork-unsubscribe hang (#37 / Lody#544). Those keep
thread/forkchildren subscribed. This PR does not change fork. Open #30 is stop-during-compact; this is process-exit waiters.Summary
On connection close/dispose, reject compaction waiters as well as turn waiters. Share the existing connection-terminal error.
runCompactstill registers the waiter first (so an earlythread/compactedis not missed), thenPromise.alls start + completion so a close before start returns cannot stall on the in-flight start RPC (vscode-jsonrpcclosedoes not rejectresponsePromises;disposedoes).finallydrops this registration only.Do not fake a successful compact. The error must reach the ACP prompt so the host
-32603recovery path can run.Visual explanation
Before / after
/compact+ process death: UI stays compacting; Stop thenalready active-32603; next prompt is notalready active/compact-32603)Test plan
vitest run src/__tests__/CodexAppServerClient.test.ts --no-file-parallelism --retry=0— 7 passed (existing turn-close gap + compact: healthy, earlythread/compacted, close after start ack, close while start still in flight, start RPC failure does not leave a waiter, compact after the connection already died).-32603in 10ms with noalready active; restart +loadSessionthen history, a normal prompt, and another compact all completed. Lifecycle 8/8 including real vscode-jsonrpc close while start is still pending. Related adapter regression 130 passed; the known/reviewslash-command timeout is a pre-existing baseline skip, not this change.Lody still needs a submodule bump after this merge.
Context
Authored with an AI coding agent. Reviewers should challenge: sharing
turnCompletionTerminalErroras connection-level vs a second compact flag;Promise.allvs awaiting start then completion; whetherfinallydisposing only this waiter is enough when start fails and the process is still alive.