Repository navigation
fix: keep the OAuth token for the nested call, and report why it failed (#131, #129) - #152
Merged
Merged
Conversation
fdaviddpt
force-pushed
the
fix/129-131-haiku-auth-diagnostics
branch
from
July 25, 2026 15:17
f4a10a0 to
fe561bd
Compare
…ed (#131, #129) Two bugs 70 lines apart in pipeline/haiku.py, one hiding the other. Shipped together because fixing #131 alone would leave the next auth failure equally undiagnosable — the reporters could only identify #131 after patching #129. (#95), but the prefix is a proxy, not a definition. CLAUDE_CODE_OAUTH_TOKEN is the child's credentials, so every nested summarization call from a setup-token or hosted-Agent-SDK install went out unauthenticated and failed — nothing ever saved. Keep it via an explicit allowlist; the rest of the family is still stripped. leave stderr empty, but the error path read only stderr. Every failure logged as "claude exited 1:" and stopped there, which hid a 7-week auth outage. Recover the message from stdout — structured field first, raw text as fallback, capped at 500 chars so a large payload isn't dumped on every failure — and say "no output on stdout or stderr" outright instead of trailing off. Four of the six new tests fail on main. Co-Authored-By: Max <noreply>
fdaviddpt
force-pushed
the
fix/129-131-haiku-auth-diagnostics
branch
from
July 25, 2026 15:20
fe561bd to
faf7342
Compare
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.
Closes #131 and #129.
Two bugs 70 lines apart in
pipeline/haiku.py, one hiding the other. Shipped together deliberately: fixing #131 alone would leave the next auth failure equally undiagnosable, and the reporters could only identify #131 after patching #129.#131 — the credential shares a prefix with the thing being stripped
_child_env()strips theCLAUDE_CODE_*family as parent-session identity (#95). But that prefix is a proxy, not a definition — andCLAUDE_CODE_OAUTH_TOKENis the child's credentials. So for anyone who authenticated withclaude setup-token, or who runs under a hosted Agent SDK, every nested summarization call went out unauthenticated and failed: nothing ever saved, for the entire install.Kept via an explicit allowlist; the rest of the family is still stripped, and a test pins both halves.
#129 — the failure was on the other stream
--output-format jsonmakes the CLI report errors as a JSON object on stdout, leaving stderr empty. The error path read only stderr, so every failure logged as:…and stopped. That is what hid a 7-week auth outage from the reporter.
The message is now recovered from stdout — structured field first (
error/result/message, including nested.message), raw text as fallback, stderr appended when present, capped at 500 chars so a large payload isn't dumped into the log on every failure. When both streams really are empty it now says(no output on stdout or stderr)rather than trailing off after the colon.Tests
Six new tests; four of them fail on
main. 531 passed.