- Propagate request headers into custom-header resolution for OpenAI/Gemini/XAI/Codex execution and websocket flows. - Resolve auth `header:` values like `$ABC` from incoming request headers at request time and omit headers when no value is available. - Add documentation for the dynamic custom-header behavior in `config.example.yaml`.
Showing the changes to internal/runtime/executor/codex_executor_execute.go (1 of 20 files). Show all
Unified · Split
| @@ -79,7 +79,7 @@ func (e *CodexExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, re · 78 unmodified lines | ||
| 79 | 79 | if err != nil { |
| 80 | 80 | return resp, err |
| 81 | 81 | } |
| 82 | − applyCodexHeaders(httpReq, auth, apiKey, true, e.cfg) | |
| 82 | + applyCodexHeaders(httpReq, auth, apiKey, true, e.cfg, opts.Headers) | |
| 83 | 83 | applyModelHeaderOverrides(httpReq.Header, baseModel) |
| 84 | 84 | applyCodexIdentityConfuseHeaders(httpReq.Header, &identityState) |
| 85 | 85 | var authID, authLabel, authType, authValue string |
| @@ -239,7 +239,7 @@ func (e *CodexExecutor) executeCompact(ctx context.Context, auth *cliproxyauth.A · 153 unmodified lines | ||
| 239 | 239 | if err != nil { |
| 240 | 240 | return resp, err |
| 241 | 241 | } |
| 242 | − applyCodexHeaders(httpReq, auth, apiKey, false, e.cfg) | |
| 242 | + applyCodexHeaders(httpReq, auth, apiKey, false, e.cfg, opts.Headers) | |
| 243 | 243 | applyModelHeaderOverrides(httpReq.Header, baseModel) |
| 244 | 244 | applyCodexIdentityConfuseHeaders(httpReq.Header, &identityState) |
| 245 | 245 | var authID, authLabel, authType, authValue string |