History

feat(executor): support `$`-based custom headers from downstream request headers

- 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`.

Luis Pater committed 2 months ago

Commit e424bfa1 parent f3e836c20 files · +646 −59Browse files

Showing the changes to internal/runtime/executor/codex_executor_execute.go (1 of 20 files). Show all

Unified · Split

internal/runtime/executor/codex_executor_execute.go+2−2
@@ -79,7 +79,7 @@ func (e *CodexExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, re · 78 unmodified lines
79 if err != nil {79 if err != nil {
80 return resp, err80 return resp, err
81 }81 }
82 applyCodexHeaders(httpReq, auth, apiKey, true, e.cfg)82 applyCodexHeaders(httpReq, auth, apiKey, true, e.cfg, opts.Headers)
83 applyModelHeaderOverrides(httpReq.Header, baseModel)83 applyModelHeaderOverrides(httpReq.Header, baseModel)
84 applyCodexIdentityConfuseHeaders(httpReq.Header, &identityState)84 applyCodexIdentityConfuseHeaders(httpReq.Header, &identityState)
85 var authID, authLabel, authType, authValue string85 var authID, authLabel, authType, authValue string
@@ -239,7 +239,7 @@ func (e *CodexExecutor) executeCompact(ctx context.Context, auth *cliproxyauth.A · 153 unmodified lines
239 if err != nil {239 if err != nil {
240 return resp, err240 return resp, err
241 }241 }
242 applyCodexHeaders(httpReq, auth, apiKey, false, e.cfg)242 applyCodexHeaders(httpReq, auth, apiKey, false, e.cfg, opts.Headers)
243 applyModelHeaderOverrides(httpReq.Header, baseModel)243 applyModelHeaderOverrides(httpReq.Header, baseModel)
244 applyCodexIdentityConfuseHeaders(httpReq.Header, &identityState)244 applyCodexIdentityConfuseHeaders(httpReq.Header, &identityState)
245 var authID, authLabel, authType, authValue string245 var authID, authLabel, authType, authValue string

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t