Skip to content

Comments

feat: add options to responses-api-proxy to support Azure#6129

Merged
bolinfest merged 1 commit intomainfrom
pr6129
Nov 3, 2025
Merged

feat: add options to responses-api-proxy to support Azure#6129
bolinfest merged 1 commit intomainfrom
pr6129

Conversation

@bolinfest
Copy link
Collaborator

@bolinfest bolinfest commented Nov 2, 2025

This PR introduces an --upstream-url option to the proxy CLI that determines the URL that Responses API requests should be forwarded to. To preserve existing behavior, the default value is "https://api.openai.com/v1/responses".

The motivation for this change is that the Codex GitHub Action should support those who use the OpenAI Responses API via Azure. Relevant issues:

Though rather than introduce a bunch of new Azure-specific logic in the action as openai/codex-action#44 proposes, we should leverage our Responses API proxy to get the hardening benefits it provides:

https://github.com/openai/codex/blob/d5853d9c47b1badad183f62622745cf47e6ff0f4/codex-rs/responses-api-proxy/README.md#hardening-details

This PR should make this straightforward to incorporate in the action. To see how the updated version of the action would consume these new options, see openai/codex-action#47.

@bolinfest
Copy link
Collaborator Author

@codex please review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bolinfest bolinfest force-pushed the pr6129 branch 5 times, most recently from 51da43c to e326a04 Compare November 3, 2025 00:45
@bolinfest bolinfest marked this pull request as ready for review November 3, 2025 00:46
Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 121 to 125
if total_read == capacity && !saw_newline && !saw_eof {
buf.zeroize();
return Err(anyhow!(
"OPENAI_API_KEY is too large to fit in the 512-byte buffer"
"API key is too large to fit in the {BUFFER_SIZE}-byte buffer"
));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Interpolate BUFFER_SIZE in overflow error

The new overflow branch emits "API key is too large to fit in the {BUFFER_SIZE}-byte buffer" without formatting, so {BUFFER_SIZE} is rendered literally in user-facing errors. The accompanying tests expect the numeric capacity (1024) and will now fail. Format the string via anyhow!("API key is too large to fit in the {}-byte buffer", BUFFER_SIZE) or similar so the constant is substituted.

Useful? React with 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe that is correct. anyhow!() should take a format string.

@bolinfest
Copy link
Collaborator Author

@pakrym-oai I don't feel strongly about the name of the option (--upstream-url) since Codex chose it. Any opinions?

@pakrym-oai
Copy link
Collaborator

Any opinions?

For a second I thought base_url but the one you have in this PR includes all parts, upstream SGTM.

@bolinfest bolinfest merged commit e1f098b into main Nov 3, 2025
25 checks passed
@bolinfest bolinfest deleted the pr6129 branch November 3, 2025 18:06
@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants