Client or integration
Codex CLI
Area
Provider adapter
Summary
neutralizeIdentity() only replaces one exact Codex identity sentence. Codex CLI 0.145.0 sends a different current sentence, so routed non-OpenAI models receive the GPT-5/OpenAI identity and may identify themselves as Codex instead of the selected model.
Expected: known Codex identity variants are replaced with NEUTRAL_IDENTITY_LINE before a request is forwarded to a routed provider.
Reproduction
- Run OpenCodex 2.7.41 with Codex CLI 0.145.0 and an
openai-chat routed non-OpenAI model.
- Ask the selected model to identify itself.
- Observe that the forwarded Codex instruction contains:
You are Codex, an agent based on GPT-5.
- Inspect
src/adapters/identity.ts. The exact string currently neutralized is:
You are Codex, a coding agent based on GPT-5.
- Because the strings differ,
String.replace() leaves the current identity instruction intact. In the observed run, the routed non-OpenAI model explicitly identified itself as Codex/GPT-5 rather than the selected model.
Version
2.7.41
Operating system
Ubuntu 22.04
Provider and model
Custom OpenAI-compatible provider using the openai-chat adapter / routed non-OpenAI model
Logs or error output
Expected neutralized input:
You are a coding agent. Do not claim to be GPT-5 or to be made by OpenAI.
Actual identity line left in the routed request:
You are Codex, an agent based on GPT-5.
Screenshots and supporting files
None. The minimal source-level reproduction above shows the exact-string mismatch.
Redacted configuration
{
"providers": {
"example": {
"adapter": "openai-chat",
"baseUrl": "https://redacted.example/v1",
"liveModels": true
}
}
}
Suggested fix
Handle a small allowlist of known exact variants, or use a narrowly scoped expression such as:
/You are Codex, (?:a coding agent|an agent) based on GPT-5(?:\.[0-9]+)?\./g
A broad You are Codex.* expression should be avoided because it could rewrite unrelated content. Tests should cover both known variants and unrelated text remaining unchanged.
Checks
Client or integration
Codex CLI
Area
Provider adapter
Summary
neutralizeIdentity()only replaces one exact Codex identity sentence. Codex CLI 0.145.0 sends a different current sentence, so routed non-OpenAI models receive the GPT-5/OpenAI identity and may identify themselves as Codex instead of the selected model.Expected: known Codex identity variants are replaced with
NEUTRAL_IDENTITY_LINEbefore a request is forwarded to a routed provider.Reproduction
openai-chatrouted non-OpenAI model.src/adapters/identity.ts. The exact string currently neutralized is:String.replace()leaves the current identity instruction intact. In the observed run, the routed non-OpenAI model explicitly identified itself as Codex/GPT-5 rather than the selected model.Version
2.7.41
Operating system
Ubuntu 22.04
Provider and model
Custom OpenAI-compatible provider using the
openai-chatadapter / routed non-OpenAI modelLogs or error output
Expected neutralized input: You are a coding agent. Do not claim to be GPT-5 or to be made by OpenAI. Actual identity line left in the routed request: You are Codex, an agent based on GPT-5.Screenshots and supporting files
None. The minimal source-level reproduction above shows the exact-string mismatch.
Redacted configuration
{ "providers": { "example": { "adapter": "openai-chat", "baseUrl": "https://redacted.example/v1", "liveModels": true } } }Suggested fix
Handle a small allowlist of known exact variants, or use a narrowly scoped expression such as:
/You are Codex, (?:a coding agent|an agent) based on GPT-5(?:\.[0-9]+)?\./gA broad
You are Codex.*expression should be avoided because it could rewrite unrelated content. Tests should cover both known variants and unrelated text remaining unchanged.Checks