fix(codex): surface remote auth and app-server errors#483
Open
Shujakuinkuraudo wants to merge 1 commit intotiann:mainfrom
Open
fix(codex): surface remote auth and app-server errors#483Shujakuinkuraudo wants to merge 1 commit intotiann:mainfrom
Shujakuinkuraudo wants to merge 1 commit intotiann:mainfrom
Conversation
Contributor
Author
There was a problem hiding this comment.
Findings
- [Major] Local Codex stderr is now hidden from the interactive terminal. Switching
stdio[2]topipeatcli/src/codex/codexLocal.ts:88routes stderr intospawnWithAbort, but that helper only bufferschild.stderrand appends it to the eventual exit error instead of forwarding it live (cli/src/utils/spawnWithAbort.ts:66,cli/src/utils/spawnWithAbort.ts:157). That means local users no longer see auth failures and other stderr diagnostics as they happen.
Suggested fix:await spawnWithTerminalGuard({ ..., stdio: ['inherit', 'inherit', 'inherit'] });
Summary
Review mode: initial. 1 major regression found in local Codex stderr handling.
Testing
Not run (automation): bun is not installed in this runner, so the targeted CLI tests could not be executed.
HAPI Bot
| logExit: true, | ||
| shell: process.platform === 'win32' | ||
| shell: process.platform === 'win32', | ||
| stdio: ['inherit', 'inherit', 'pipe'] |
There was a problem hiding this comment.
[MAJOR] Piping stderr here hides it from local interactive users. In this path spawnWithAbort only buffers child.stderr for the final rejection text and never writes it back to process.stderr, so auth failures and other diagnostics disappear until the process exits.
Suggested fix:
await spawnWithTerminalGuard({
...,
stdio: ['inherit', 'inherit', 'inherit']
});
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.

Summary
task_failedevents with real error details to pass terminal turn guardsProblem
Real Codex failures such as 401 auth errors or upstream high-demand errors were often visible only in Codex stderr, while HAPI remote/web UI showed only generic failures or nothing useful.
A concrete failure mode was:
task_failed-like failure withoutturn_idChanges
CodexAppServerErrormetadata:stderrTail, stage, exit code, signal, error code, retryabilitytask_failedtext into session messages for web/mobile visibilityValidation
bun test cli/src/codex/utils/terminalEventGuard.test.tsbun typecheckbun run build:single-exehttps://hapi.server4.shujk.topTask failed: unexpected status 401 Unauthorized ...