Fix Codex cancellation and output handling; stabilize Claude sessions - #84
Merged
Merged
Conversation
Germey
approved these changes
Oct 4, 2026
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.
Local sessions could keep shell commands running after Stop, hang on JSON events larger than 64 KiB, hide or reorder Claude answers, and block commands behind multi-GB history scans. This change terminates the Codex process tree, bounds and drains output safely, preserves Claude complete/streamed message ordering and fork identities, and caches unchanged history summaries while keeping discovery off the command path.
Also detects the SDK-bundled Claude CLI, honors explicit CLI paths and CODEX_HOME, applies Claude effort changes by resuming the same transcript, fails code-restore errors explicitly, denies pending approvals on stop, and uses stable Homebrew opt interpreter paths for new service installations. Removes artificial Codex typewriter delays and slash-command suggestions that exec cannot execute.
Validation:
ruff check .;NO_PROXY=127.0.0.1,localhost pytest -q— 643 passed. New real-subprocess regressions cover 70 KB–2 MB stdout/stderr, oversized events, clean exits without results, detached children, and cancellation cleanup.Live acceptance on macOS used studio.acedata.cloud, the production relay, and this patched local node: Codex and Claude both fixed fixture code, passed tests, stopped running commands, and continued with remembered context. Claude additionally passed attachment reading, allow/deny approvals, AskUserQuestion, restart/history resume, edit-fork identity, and /status. Unchanged 200-session history refresh improved from 11.749 s to 0.538 s. Synthetic fixtures and evidence are retained locally; no customer repositories were modified.
Rollout: publish the agent and restart node daemons. Existing Homebrew service units require one reinstall to replace stale Cellar paths. The companion Nexior PR handles accurate permission and stopped-state labels. Windows process-tree code is covered structurally but was not live-tested. No merge or production release performed.
Review: self-reviewed code and regression evidence; no separately requested adversarial review.
Final history coverage also excludes injected context from titles, preserves custom Codex patch tools, and omits binary media payloads from relayed/history tool results.