Skip to content

codex-responses-api-proxy fails with "API key is too large to fit in the 1024-byte buffer" when using Azure AD access tokens #17099

@stias

Description

@stias

What issue are you seeing?

The proxy should accept API keys / bearer tokens longer than 1024 bytes. Calling the Azure OpenAI Responses API directly with the same token via curl works correctly, confirming the token itself is valid.

What steps can reproduce the bug?

  1. Obtain an Azure AD access token:

    az account get-access-token
    --resource https://cognitiveservices.azure.com
    --query accessToken -o tsv

  2. Confirm the token size exceeds 1024 bytes:

    az account get-access-token
    --resource https://cognitiveservices.azure.com
    --query accessToken -o tsv | wc -c # outputs ~1400–1800

  3. Use the token as openai-api-key in codex-action with responses-api-endpoint set to an Azure OpenAI endpoint.

  4. The action fails at the "Start Responses API proxy" step with:
    Error: API key is too large to fit in the 1024-byte buffer

What is the expected behavior?

When using an Azure AD access token (obtained via az account get-access-token --resource https://cognitiveservices.azure.com --query accessToken -o tsv) as the openai-api-key input, codex-responses-api-proxy fails immediately with:

Error: API key is too large to fit in the 1024-byte buffer

Azure AD JWT access tokens are typically 1200–1800 bytes, which exceeds the proxy's fixed 1024-byte stdin read buffer. This causes the action to time out and report "responses-api-proxy did not write server info".

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssues related to authentication and accountsazureIssues related to the Azure-hosted OpenAI modelsbugSomething isn't workinggithub-actionIssues related to the Codex github action

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions