Log OpenAI OAuth error responses - #96
Open
k2v7n24cbf-cyber wants to merge 1 commit into
Open
Conversation
k2v7n24cbf-cyber
force-pushed
the
agent/openai-oauth-subagent-model
branch
from
July 20, 2026 07:20
f2d5a97 to
3d2e7ab
Compare
k2v7n24cbf-cyber
force-pushed
the
agent/openai-oauth-subagent-model
branch
from
July 20, 2026 07:28
3d2e7ab to
48c7d84
Compare
k2v7n24cbf-cyber
marked this pull request as ready for review
July 20, 2026 08:36
k2v7n24cbf-cyber
added a commit
to k2v7n24cbf-cyber/openacme
that referenced
this pull request
Jul 22, 2026
Merge staged copy of sandydasari#96 into local-stage.
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.
Log OpenAI OAuth error responses
Summary
This PR is intentionally logging-only.
Response.clone(), so the original response is still returned unchanged to the AI SDK.generateObject()usage.generateText()fallback.Reason / RCA
In a live OpenAcme deployment using OpenAI ChatGPT OAuth, auxiliary helper calls such as title generation and memory selection were failing with only:
The existing logs showed the failing requests were going through the ChatGPT OAuth / Codex backend path, but they did not preserve the upstream OpenAI error response body. Because of that, we could not determine the actual rejected field or backend validation reason.
The objective of this PR is only to expose the missing evidence. It does not attempt to fix or work around the failure.
Implementation Notes
The OpenAI OAuth fetch wrapper in
packages/llm-provider/src/registry.tsnow calls a logging helper after the final response is available, including after the existing 401 refresh-and-retry path.For any final non-2xx response, it logs:
provider: "openai"auth: "oauth"cf-rayopenai-processing-msx-openai-request-idx-request-idx-stainless-request-idIt does not log authorization headers or request bodies.
Validation
pnpm --filter @openacme/config buildpnpm --filter @openacme/auth buildpnpm --filter @openacme/llm-provider check-typespnpm --filter @openacme/llm-provider test -- subagent-model.test.tspnpm --filter @openacme/llm-provider buildpnpm build