-
Notifications
You must be signed in to change notification settings - Fork 296
[WIP] Enable --enable-api-proxy for Claude and Codex engines #15550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,9 +107,8 @@ func collectDockerImages(tools map[string]any, workflowData *WorkflowData, actio | |
|
|
||
| // Add api-proxy sidecar container for engines that use --enable-api-proxy | ||
| // The api-proxy holds LLM API keys securely and proxies requests through Squid: | ||
| // - Port 10000: OpenAI API proxy (for Codex) | ||
| // - Port 10001: Anthropic API proxy (for Claude) | ||
| if workflowData != nil && (workflowData.AI == "claude" || workflowData.AI == "codex") { | ||
| if workflowData != nil && workflowData.AI == "claude" { | ||
| apiProxyImage := constants.DefaultFirewallRegistry + "/api-proxy:" + awfImageTag | ||
|
Comment on lines
108
to
112
|
||
| if !imageSet[apiProxyImage] { | ||
| images = append(images, apiProxyImage) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,7 @@ import ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testing" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // TestEngineAWFEnableApiProxy tests that Claude and Codex engines include --enable-api-proxy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // TestEngineAWFEnableApiProxy tests that Claude engine includes --enable-api-proxy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // in AWF commands, while Copilot does not. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| func TestEngineAWFEnableApiProxy(t *testing.T) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| t.Run("Claude AWF command includes enable-api-proxy flag", func(t *testing.T) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -35,33 +35,6 @@ func TestEngineAWFEnableApiProxy(t *testing.T) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| t.Run("Codex AWF command does not include enable-api-proxy flag", func(t *testing.T) { | |
| workflowData := &WorkflowData{ | |
| Name: "test-workflow", | |
| EngineConfig: &EngineConfig{ | |
| ID: "codex", | |
| }, | |
| NetworkPermissions: &NetworkPermissions{ | |
| Firewall: &FirewallConfig{ | |
| Enabled: true, | |
| }, | |
| }, | |
| } | |
| engine := NewCodexEngine() | |
| steps := engine.GetExecutionSteps(workflowData, "test.log") | |
| if len(steps) == 0 { | |
| t.Fatal("Expected at least one execution step") | |
| } | |
| stepContent := strings.Join(steps[0], "\n") | |
| if strings.Contains(stepContent, "--enable-api-proxy") { | |
| t.Error("Expected Codex AWF command to NOT contain '--enable-api-proxy' flag") | |
| } | |
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR title says enabling
--enable-api-proxyfor Claude and Codex, but this change removes--enable-api-proxyfrom the Codex engine. Please align the PR title/description with the actual change (either update the title to reflect reverting Codex support, or reintroduce Codex support if that’s the intent).