Skip to content

Codex namespace flattening can exceed upstream function-name limits #133

Description

@haoshan98

Description

While validating Codex support, we found that flattened namespace member names can exceed the 64-character limit used by some Responses-compatible providers.

amespace members are currently flattened as:

agentic_ns__{namespace}__{member}

For example, the following generated name is 76 characters:

agentic_ns__mcp__codex_apps__github___remove_reaction_from_pr_review_comment

Steps to reproduce

  1. Send a Codex request containing the mcp__codex_apps__github namespace and
    _remove_reaction_from_pr_review_comment member.
  2. The gateway forwards the 76-character flattened name as an upstream function declaration.
  3. An upstream provider enforcing a 64-character limit rejects the request before inference, typically with HTTP 422.

Expected behavior

Gateway-generated namespace member names should stay within the upstream limit and still be restored to the original public { namespace, name } representation in the response.

Actual behavior

The gateway forwards the full flattened name without a length bound, allowing one long namespace member to reject the entire request.

Environment

No response

Additional context

A likely direction is to preserve short names and shorten only long generated names using a readable prefix plus a
deterministic fingerprint. The existing request-scoped namespace map can restore the original names without parsing the shortened value.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions