Repository navigation
fix: forward app-server stderr to adapter stderr - #616
Open
delete-cloud wants to merge 1 commit into
Open
delete-cloud wants to merge 1 commit into
delete-cloud wants to merge 1 commit into
Conversation
Forward app-server stderr buffers unchanged to adapter stderr while the child is running, independent of APP_SERVER_LOGS. Keep the optional file copy, JSON-RPC stdout handling, and crash-time stderr capture. Ignore EPIPE and ERR_STREAM_DESTROYED on adapter stderr so diagnostics written after the client closes the stderr reader do not terminate the adapter; other errors still propagate. Assisted-by: GPT-6 Astra
This branch has not been deployed
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
App-server diagnostics are invisible to ACP clients while the process is running. APP_SERVER_LOGS only provides an optional file copy, and crash-time stderr capture does not expose live diagnostics.
Fix
Forward stderr buffers unchanged to adapter stderr, preserving optional file logging, JSON-RPC stdout handling, and crash-time stderr capture. No prefix or additional configuration is needed.
Writes intentionally do not apply backpressure: the app-server stderr tracing layer defaults to ERROR, with verbosity controlled by RUST_LOG. A process-wide stderr error listener ignores EPIPE and ERR_STREAM_DESTROYED, so late diagnostics after the client closes the adapter's stderr reader no longer terminate the adapter; other errors still propagate. The codex-acp login command now also displays app-server diagnostics in the terminal. Both READMEs document forwarding and optional file logging.
Tests
Typecheck and the full test suite pass. Controlled subprocess tests cover forwarding with and without file logging, absence of log files when disabled, JSON-RPC responses, stdout isolation, UTF-8 across chunk boundaries, and successful operation after the stderr reader closes (POSIX only; skipped on Windows). The new tests pass three consecutive runs with retries disabled. Removing the closed-stream protection makes the new regression test fail.
This fix is already in use downstream in LodyAI/acp-extension-codex#64.
Assisted-by: GPT-6 Astra