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
7979 if err != nil {
8080 return resp, err
8181 }
82− applyCodexHeaders(httpReq, auth, apiKey, true, e.cfg)
82+ applyCodexHeaders(httpReq, auth, apiKey, true, e.cfg, opts.Headers)
8383 applyModelHeaderOverrides(httpReq.Header, baseModel)
8484 applyCodexIdentityConfuseHeaders(httpReq.Header, &identityState)
8585 var authID, authLabel, authType, authValue string
@@ -239,7 +239,7 @@ func (e *CodexExecutor) executeCompact(ctx context.Context, auth *cliproxyauth.A · 153 unmodified lines
239239 if err != nil {
240240 return resp, err
241241 }
242− applyCodexHeaders(httpReq, auth, apiKey, false, e.cfg)
242+ applyCodexHeaders(httpReq, auth, apiKey, false, e.cfg, opts.Headers)
243243 applyModelHeaderOverrides(httpReq.Header, baseModel)
244244 applyCodexIdentityConfuseHeaders(httpReq.Header, &identityState)
245245 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