-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Currently Codex fails when routed via AI Bridge; it just fails without any error message (classic).
Here's the config we tested with:
[projects."/private/tmp"]
trust_level = "trusted"
[model_providers.bridge]
name = "Bridge"
base_url = "https://.../api/experimental/aibridge/openai/v1"
env_key = "BRIDGE_API_KEY"
wire_api = "chat"
[profiles.bridge]
model_provider = "bridge"
model = "gpt-5"
We looked into the issue and the cause is Codex borks because the SDK we're using marshals zero values.
If we strip all the zero values then Codex happily processes the request.
The problem is that marshaling the payloads without the zero values is not so simple: https://github.com/openai/openai-go?tab=readme-ov-file#request-fields
Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, openai.String(string), openai.Int(int64), etc.
We'd either have to post-process the marshaled values, implement our own marshaler which excludes zero values (using reflection), or something else. Go 1.25's JSONv2 package could be interesting, too.