[codex] remove openai request guard#3
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed\n- Kept the NVIDIA Nemotron routing updates in place.\n- Reverted the OpenAI request-field protection so provider extra body fields merge directly again.\n\n## Validation\n-
TAP version 13
{"level":30,"time":1780441820159,"pid":34061,"hostname":"Revants-MacBook-Pro.local","request_id":"32fb6644-3339-4982-bb77-6e54b3ba43f5","backend":"local","source_model":"claude-3-5-sonnet-latest","target_model":"local-model","latency_ms":1,"status":200,"msg":"message routed"}
Subtest: e2e matrix local: multi-turn keeps prior context
ok 1 - e2e matrix local: multi-turn keeps prior context
duration_ms: 49.176042
type: 'test'
...
{"level":30,"time":1780441820173,"pid":34061,"hostname":"Revants-MacBook-Pro.local","request_id":"285a207e-f69f-443f-a22f-b1cf524901c5","backend":"nvidia","source_model":"claude-3-5-sonnet-latest","target_model":"nvidia-model","latency_ms":1,"status":200,"msg":"message routed"}
Subtest: e2e matrix nvidia: multi-turn keeps prior context
ok 2 - e2e matrix nvidia: multi-turn keeps prior context
duration_ms: 8.915208
type: 'test'
...
{"level":30,"time":1780441820207,"pid":34061,"hostname":"Revants-MacBook-Pro.local","request_id":"32570129-98d3-4609-bc0a-dfe3a9f13a93","backend":"openrouter","source_model":"claude-3-5-sonnet-latest","target_model":"openrouter-model","latency_ms":1,"status":200,"msg":"message routed"}
Subtest: e2e matrix openrouter: multi-turn keeps prior context
ok 3 - e2e matrix openrouter: multi-turn keeps prior context
duration_ms: 32.46425
type: 'test'
...
{"level":30,"time":1780441820219,"pid":34061,"hostname":"Revants-MacBook-Pro.local","request_id":"0c10e668-3ecd-4a2b-adfe-7a0af09014af","backend":"local","source_model":"claude-3-5-sonnet-latest","target_model":"local-model","latency_ms":0,"status":200,"msg":"message routed"}
Subtest: e2e matrix local: tool call and tool_result round-trip
ok 4 - e2e matrix local: tool call and tool_result round-trip
duration_ms: 12.112667
type: 'test'
...
{"level":30,"time":1780441820234,"pid":34061,"hostname":"Revants-MacBook-Pro.local","request_id":"6b1920ac-760e-45c3-a464-c0741aedd755","backend":"nvidia","source_model":"claude-3-5-sonnet-latest","target_model":"nvidia-model","latency_ms":0,"status":200,"msg":"message routed"}
Subtest: e2e matrix nvidia: tool call and tool_result round-trip
ok 5 - e2e matrix nvidia: tool call and tool_result round-trip
duration_ms: 15.126042
type: 'test'
...
{"level":30,"time":1780441820237,"pid":34061,"hostname":"Revants-MacBook-Pro.local","request_id":"18c61e70-4bb8-479f-bed3-71340060ec14","backend":"openrouter","source_model":"claude-3-5-sonnet-latest","target_model":"openrouter-model","latency_ms":0,"status":200,"msg":"message routed"}
Subtest: e2e matrix openrouter: tool call and tool_result round-trip
ok 6 - e2e matrix openrouter: tool call and tool_result round-trip
duration_ms: 3.159625
type: 'test'
...
Subtest: e2e malformed request returns clear 400 invalid_request_error
ok 7 - e2e malformed request returns clear 400 invalid_request_error
duration_ms: 2.409542
type: 'test'
...
{"level":50,"time":1780441820240,"pid":34061,"hostname":"Revants-MacBook-Pro.local","request_id":"a6c152ac-007a-46a5-a334-710e56b4c262","status":400,"error_type":"invalid_request_error","error_message":"Missing or invalid field: max_tokens","msg":"request failed"}
{"level":50,"time":1780441820251,"pid":34061,"hostname":"Revants-MacBook-Pro.local","request_id":"53458398-7903-4062-ba92-ad82f2b6d55f","status":502,"error_type":"provider_error","error_message":"Provider returned HTTP 503: {\"error\":\"temporarily unavailable\"}","msg":"request failed"}
Subtest: e2e matrix local: provider 503 retries then returns mapped error
ok 8 - e2e matrix local: provider 503 retries then returns mapped error
duration_ms: 11.992041
type: 'test'
...
{"level":50,"time":1780441820260,"pid":34061,"hostname":"Revants-MacBook-Pro.local","request_id":"30deba1e-5a57-4b0a-8fe8-8f3d03cf9f9c","status":502,"error_type":"provider_error","error_message":"Provider returned HTTP 503: {\"error\":\"temporarily unavailable\"}","msg":"request failed"}
Subtest: e2e matrix nvidia: provider 503 retries then returns mapped error
ok 9 - e2e matrix nvidia: provider 503 retries then returns mapped error
duration_ms: 10.141458
type: 'test'
...
{"level":50,"time":1780441820269,"pid":34061,"hostname":"Revants-MacBook-Pro.local","request_id":"d1b5c6d0-29b0-4c65-af3d-d0a232dc1153","status":502,"error_type":"provider_error","error_message":"Provider returned HTTP 503: {\"error\":\"temporarily unavailable\"}","msg":"request failed"}
Subtest: e2e matrix openrouter: provider 503 retries then returns mapped error
ok 10 - e2e matrix openrouter: provider 503 retries then returns mapped error
duration_ms: 7.3375
type: 'test'
...
{"level":30,"time":1780441820276,"pid":34061,"hostname":"Revants-MacBook-Pro.local","request_id":"38faf8a6-0b6b-471b-a1ac-68683b6672e6","backend":"nvidia","source_model":"claude-3-5-sonnet-latest","target_model":"nvidia-model","latency_ms":2,"status":200,"msg":"message routed"}
Subtest: e2e nvidia 202 polling follows status endpoint until completion
ok 11 - e2e nvidia 202 polling follows status endpoint until completion
duration_ms: 6.779834
type: 'test'
...
Subtest: buildClaudeEnv: sets default base URL and dummy auth token
ok 12 - buildClaudeEnv: sets default base URL and dummy auth token
duration_ms: 0.4375
type: 'test'
...
Subtest: buildClaudeEnv: respects user-provided ANTHROPIC_BASE_URL
ok 13 - buildClaudeEnv: respects user-provided ANTHROPIC_BASE_URL
duration_ms: 0.195083
type: 'test'
...
Subtest: buildClaudeEnv: preserves user-provided ANTHROPIC_AUTH_TOKEN
ok 14 - buildClaudeEnv: preserves user-provided ANTHROPIC_AUTH_TOKEN
duration_ms: 0.087708
type: 'test'
...
Subtest: buildClaudeEnv: keeps managed auth explicit when requested
ok 15 - buildClaudeEnv: keeps managed auth explicit when requested
duration_ms: 0.073042
type: 'test'
...
Subtest: buildClaudeEnv: respects CLAUDIA_CLAUDE_MODEL override
ok 16 - buildClaudeEnv: respects CLAUDIA_CLAUDE_MODEL override
duration_ms: 0.062458
type: 'test'
...
Subtest: buildClaudeEnv: args defaultModel overrides built-in default
ok 17 - buildClaudeEnv: args defaultModel overrides built-in default
duration_ms: 0.052916
type: 'test'
...
Subtest: buildClaudeEnv: CLAUDIA_CLAUDE_MODEL takes precedence over args default
ok 18 - buildClaudeEnv: CLAUDIA_CLAUDE_MODEL takes precedence over args default
duration_ms: 0.050042
type: 'test'
...
Subtest: buildClaudeEnv: explicit CLI model takes precedence over environment defaults
ok 19 - buildClaudeEnv: explicit CLI model takes precedence over environment defaults
duration_ms: 0.125875
type: 'test'
...
Subtest: buildClaudeEnv: preserves other user env vars
ok 20 - buildClaudeEnv: preserves other user env vars
duration_ms: 0.293875
type: 'test'
...
Subtest: buildClaudeArgs: adds the default model without unsupported interactive flags
ok 21 - buildClaudeArgs: adds the default model without unsupported interactive flags
duration_ms: 1.574833
type: 'test'
...
Subtest: buildClaudeArgs: adds default model with other args
ok 22 - buildClaudeArgs: adds default model with other args
duration_ms: 0.112959
type: 'test'
...
Subtest: buildClaudeArgs: respects explicit --model as separate flag
ok 23 - buildClaudeArgs: respects explicit --model as separate flag
duration_ms: 0.054959
type: 'test'
...
Subtest: buildClaudeArgs: respects explicit --model=combined flag
ok 24 - buildClaudeArgs: respects explicit --model=combined flag
duration_ms: 0.046792
type: 'test'
...
Subtest: buildClaudeArgs: detects --model in any position
ok 25 - buildClaudeArgs: detects --model in any position
duration_ms: 0.126875
type: 'test'
...
Subtest: buildClaudeArgs: doesn't duplicate --model if already present
ok 26 - buildClaudeArgs: doesn't duplicate --model if already present
duration_ms: 0.0535
type: 'test'
...
Subtest: buildClaudeArgs: removes wrapper-only auth flags
ok 27 - buildClaudeArgs: removes wrapper-only auth flags
duration_ms: 0.045208
type: 'test'
...
Subtest: resolveClaudeModel: reads separate and combined CLI model flags
ok 28 - resolveClaudeModel: reads separate and combined CLI model flags
duration_ms: 0.052
type: 'test'
...
Subtest: wrapper launches Claude with dummy auth by default
ok 29 - wrapper launches Claude with dummy auth by default
duration_ms: 293.5305
type: 'test'
...
Subtest: wrapper can opt into managed auth and keeps explicit model selection consistent
ok 30 - wrapper can opt into managed auth and keeps explicit model selection consistent
duration_ms: 194.926
type: 'test'
...
Subtest: wrapper prints a helpful error when Claude Code is missing
ok 31 - wrapper prints a helpful error when Claude Code is missing
duration_ms: 47.032042
type: 'test'
...
Subtest: wrapper loads the active profile from .env for later runs
ok 32 - wrapper loads the active profile from .env for later runs
duration_ms: 189.696792
type: 'test'
...
Subtest: configuration wizard aborts cleanly when existing files are not approved
ok 33 - configuration wizard aborts cleanly when existing files are not approved
duration_ms: 2.016459
type: 'test'
...
Subtest: configuration wizard generates a local-provider config from line answers
ok 34 - configuration wizard generates a local-provider config from line answers
duration_ms: 0.857541
type: 'test'
...
Subtest: configuration wizard awaits remote connectivity before completion
ok 35 - configuration wizard awaits remote connectivity before completion
duration_ms: 21.689583
type: 'test'
...
Subtest: router CLI reports the package version
ok 36 - router CLI reports the package version
duration_ms: 84.054375
type: 'test'
...
Subtest: router CLI can delegate to the doctor command in ESM mode
ok 37 - router CLI can delegate to the doctor command in ESM mode
duration_ms: 234.6995
type: 'test'
...
Subtest: router CLI help includes init as the first-run path
ok 38 - router CLI help includes init as the first-run path
duration_ms: 52.890583
type: 'test'
...
Subtest: loads legacy modelMap configs without modelProfiles
ok 39 - loads legacy modelMap configs without modelProfiles
duration_ms: 3.865
type: 'test'
...
Subtest: loads model profiles and normalizes model as a providerModel alias
ok 40 - loads model profiles and normalizes model as a providerModel alias
duration_ms: 1.253333
type: 'test'
...
Subtest: README and QUICKSTART keep first-run setup paths aligned
ok 41 - README and QUICKSTART keep first-run setup paths aligned
duration_ms: 1.233834
type: 'test'
...
Subtest: README explicitly documents current limitations
ok 42 - README explicitly documents current limitations
duration_ms: 0.143959
type: 'test'
...
Subtest: fails when NVIDIA_API_KEY is missing
ok 43 - fails when NVIDIA_API_KEY is missing
duration_ms: 1.935041
type: 'test'
...
Subtest: passes when prerequisites and NVIDIA_API_KEY are configured
ok 44 - passes when prerequisites and NVIDIA_API_KEY are configured
duration_ms: 0.889416
type: 'test'
...
Subtest: checks provider-specific key based on config defaultBackend
ok 45 - checks provider-specific key based on config defaultBackend
duration_ms: 0.851042
type: 'test'
...
Subtest: key command updates the NVIDIA API key in .env
ok 46 - key command updates the NVIDIA API key in .env
duration_ms: 0.9535
type: 'test'
...
Subtest: key command can load a new key from an environment variable
ok 47 - key command can load a new key from an environment variable
duration_ms: 0.356708
type: 'test'
...
Subtest: key command rejects providers that do not require a key
ok 48 - key command rejects providers that do not require a key
duration_ms: 0.156167
type: 'test'
...
Subtest: passes Anthropic tools through as OpenAI function tools
ok 49 - passes Anthropic tools through as OpenAI function tools
duration_ms: 0.937208
type: 'test'
...
Subtest: merges provider-specific extra body fields into OpenAI requests
ok 50 - merges provider-specific extra body fields into OpenAI requests
duration_ms: 0.061375
type: 'test'
...
Subtest: converts Anthropic tool results into OpenAI tool messages
ok 51 - converts Anthropic tool results into OpenAI tool messages
duration_ms: 0.072333
type: 'test'
...
Subtest: converts OpenAI tool calls into Anthropic tool_use response blocks
ok 52 - converts OpenAI tool calls into Anthropic tool_use response blocks
duration_ms: 0.19225
type: 'test'
...
Subtest: preserves transient provider status semantics
ok 53 - preserves transient provider status semantics
duration_ms: 0.071875
type: 'test'
...
Subtest: polls pending NVIDIA responses until the result is ready
ok 54 - polls pending NVIDIA responses until the result is ready
duration_ms: 29.309166
type: 'test'
...
Subtest: automatically shrinks completion budget when the provider reports a context overflow
ok 55 - automatically shrinks completion budget when the provider reports a context overflow
duration_ms: 0.806292
type: 'test'
...
Subtest: formats completed responses as Anthropic SSE events
ok 56 - formats completed responses as Anthropic SSE events
duration_ms: 0.665542
type: 'test'
...
Subtest: profile show reports unset state when CLAUDIA_CLAUDE_MODEL is missing
ok 57 - profile show reports unset state when CLAUDIA_CLAUDE_MODEL is missing
duration_ms: 0.58625
type: 'test'
...
Subtest: profile command sets the active fast profile in .env
ok 58 - profile command sets the active fast profile in .env
duration_ms: 0.498208
type: 'test'
...
Subtest: profile list shows the available presets
ok 59 - profile list shows the available presets
duration_ms: 0.390458
type: 'test'
...
Subtest: profile chooser opens on no arguments and can select glm
ok 60 - profile chooser opens on no arguments and can select glm
duration_ms: 0.70425
type: 'test'
...
Subtest: profile chooser defaults to fast when the user presses Enter
ok 61 - profile chooser defaults to fast when the user presses Enter
duration_ms: 0.381333
type: 'test'
...
Subtest: profile chooser can switch to local provider
ok 62 - profile chooser can switch to local provider
duration_ms: 1.319334
type: 'test'
...
Subtest: profile toggle flips between fast and glm
ok 63 - profile toggle flips between fast and glm
duration_ms: 0.742667
type: 'test'
...
Subtest: profile command rejects unsupported profiles
ok 64 - profile command rejects unsupported profiles
duration_ms: 0.242625
type: 'test'
...
Subtest: package metadata is ready for npm publish
ok 65 - package metadata is ready for npm publish
duration_ms: 0.825291
type: 'test'
...
Subtest: README documents the npm install path for published builds
ok 66 - README documents the npm install path for published builds
duration_ms: 0.119709
type: 'test'
...
Subtest: quickstart can set a profile after setup and doctor complete
ok 67 - quickstart can set a profile after setup and doctor complete
duration_ms: 1.683333
type: 'test'
...
Subtest: quickstart rejects unsupported profile names
ok 68 - quickstart rejects unsupported profile names
duration_ms: 1.863333
type: 'test'
...
Subtest: routes Anthropic tool requests to OpenAI tools and returns tool_use blocks
ok 69 - routes Anthropic tool requests to OpenAI tools and returns tool_use blocks
duration_ms: 29.912917
type: 'test'
...
Subtest: resolves model profiles with routing metadata before legacy modelMap entries
ok 70 - resolves model profiles with routing metadata before legacy modelMap entries
duration_ms: 0.169125
type: 'test'
...
Subtest: uses model profile retry settings for provider calls
ok 71 - uses model profile retry settings for provider calls
duration_ms: 3.611291
type: 'test'
...
{"level":30,"time":1780441820374,"pid":34077,"hostname":"Revants-MacBook-Pro.local","request_id":"6fe32119-1273-4e4d-aca0-42307c7d81c5","backend":"local","source_model":"claude-3-5-sonnet-latest","target_model":"test-model","latency_ms":1,"status":200,"msg":"message routed"}
Subtest: returns Anthropic SSE events for streaming requests
ok 72 - returns Anthropic SSE events for streaming requests
duration_ms: 47.532292
type: 'test'
...
Subtest: error messages include port number and actionable guidance
ok 73 - error messages include port number and actionable guidance
duration_ms: 0.149083
type: 'test'
...
Subtest: creates setup files, prompts for a missing key, and runs the NVIDIA smoke request
ok 74 - creates setup files, prompts for a missing key, and runs the NVIDIA smoke request
duration_ms: 16.249459
type: 'test'
...
Subtest: reuses an existing key without prompting
ok 75 - reuses an existing key without prompting
duration_ms: 1.090625
type: 'test'
...
Subtest: uses api-key-env and skip-smoke for a provider override
ok 76 - uses api-key-env and skip-smoke for a provider override
duration_ms: 0.515833
type: 'test'
...
Subtest: reports provider-specific smoke completion for provider overrides
ok 77 - reports provider-specific smoke completion for provider overrides
duration_ms: 0.419042
type: 'test'
...
Subtest: fails before setup when Claude Code is unavailable
ok 78 - fails before setup when Claude Code is unavailable
duration_ms: 0.198625
type: 'test'
...
Subtest: reports NVIDIA smoke request failures without exposing the key
ok 79 - reports NVIDIA smoke request failures without exposing the key
duration_ms: 0.579417
type: 'test'
...
Subtest: skips provider confirmation when asked
ok 80 - skips provider confirmation when asked
duration_ms: 0.456208
type: 'test'
...
Subtest: stops cleanly when the configuration wizard is aborted
ok 81 - stops cleanly when the configuration wizard is aborted
duration_ms: 0.324083
type: 'test'
...
Subtest: router status prints the active profile and routing summary
ok 82 - router status prints the active profile and routing summary
duration_ms: 2247.326333
type: 'test'
...
Subtest: router status points to key rotation when the configured provider key is missing
ok 83 - router status points to key rotation when the configured provider key is missing
duration_ms: 2208.030208
type: 'test'
...
1..83
tests 83
suites 0
pass 83
fail 0
cancelled 0
skipped 0
todo 0
duration_ms 5035.49 passed\n\n## Notes\n- The branch is published and ready for review.