Repository navigation
Closed
Labels
Description
I tried to use the new Custom API Endpoints via Environment Variables, but it seems to have a bug.
I added this:
engine:
id: codex
model: "openrouter/free"
env:
OPENAI_BASE_URL: "https://openrouter.ai/api/v1"
OPENAI_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}But I found this in the agent job log. It seems to use gpt-5.3-codex model.
2026-03-14T22:21:22.758990Z DEBUG session_init: codex_core::codex: Configuring session: model=gpt-5.3-codex; provider=ModelProviderInfo { name: "OpenAI", base_url: Some("http://172.30.0.30:10000/v1"), env_key: None, env_key_instructions: None, experimental_bearer_token: None, wire_api: Responses, query_params: None, http_headers: Some({"version": "0.114.0"}), env_http_headers: Some({"OpenAI-Organization": "OPENAI_ORGANIZATION", "OpenAI-Project": "OPENAI_PROJECT"}), request_max_retries: None, stream_max_retries: None, stream_idle_timeout_ms: None, requires_openai_auth: true, supports_websockets: true }
Knowing that I tried to configure Codex locally with the same base URL (https://openrouter.ai/api/v1) and model (openrouter/free), and it works properly.
~/.codex/config.toml:
model_provider = "openrouter"
model="openrouter/free"
[model_providers.openrouter]
name = "openrouter"
base_url="https://openrouter.ai/api/v1"
env_key="OPENROUTER_API_KEY"
The agent summary:
Agentic Conversation
Conversation:
Agent: stream disconnected before completion: stream closed before response.completed
Agent: Reconnect attempts: 5/5
Statistics:
MCP Gateway
- ✓ startup MCPG Gateway version: v0.1.15
- ✓ startup Starting MCPG with config: stdin, listen: 0.0.0.0:80, log-dir: /tmp/gh-aw/mcp-logs/
- ✓ startup Loaded 2 MCP server(s): [github safeoutputs]
- ✓ startup Guards sink server ID logging enrichment disabled
- ✓ backend
Successfully connected to MCP backend server, command=docker - 🔍 rpc github→
tools/list - 🔍 rpc safeoutputs→
tools/list - 🔍 rpc safeoutputs←
resp{"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"create_pull_request","description":"Create a new GitHub pull request to propose code changes. Use this after making file edits to submit them for review and merging. The PR will be created from the current branch with your committed changes. For code review comments on an existing PR, use create_pull_request_review_comment instead. CONSTRAINTS: Maximum 1 pull request(s) can be created. Title will be prefixed with \"[code-simplifier] \". Labels [\"refactori... - 🔍 rpc github←
resp{"jsonrpc":"2.0","id":1,"result":{"tools":[{"annotations":{"readOnlyHint":true,"title":"Get commit details"},"description":"Get details for a commit from a GitHub repository","inputSchema":{"properties":{"include_diff":{"default":true,"description":"Whether to include file diffs and stats in the response. Default is true.","type":"boolean"},"owner":{"description":"Repository owner","type":"string"},"page":{"description":"Page number for pagination (min 1)","minimum":1,"type":"number"},"perPage":{"descriptio... - ✓ startup Starting in ROUTED mode on 0.0.0.0:80
- ✓ startup Routes: /mcp/ for servers: [github safeoutputs]
Firewall Activity
▼ 6 requests | 6 allowed | 0 blocked | 1 unique domain
| Domain | Allowed | Denied |
|---|---|---|
| openrouter.ai | 6 | 0 |
Reacted by Copilot
Activity
pelikhan commentedon Mar 15, 2026
@copilot update the agentic engine to declare the command api base url environment variable like "OPENAI_BASE_URL" (determine the ones from copilot/claude/gemini) and configure the api-target URL passed to awf accordingly. The compiler should detect this environment variable in the yaml and special treat it. Make sure the example above is operational.
agross commentedon Mar 17, 2026
Same for me, but with MiniMax:
Firewall Activity
▼ 3 requests | 3 allowed | 0 blocked | 2 unique domains
samuelkahessay commentedon Mar 22, 2026
Still reproducible for me on
gh-aw v0.62.5with OpenRouter.Using
engine.id: codexplusOPENAI_BASE_URL: https://openrouter.ai/api/v1, the compiled run kept Codex on the AWF proxy path (--enable-api-proxy+--openai-api-target openrouter.ai). At runtime Codex initialized against the local AWF proxy with the built-in OpenAI provider andsupports_websockets: true, then failed with:The only repo-side workaround I found is patching the generated lockfile after
gh aw compileto remove the AWF proxy path and inject a custom Codex provider withsupports_websockets = false. That makes OpenRouter work over HTTP-only transport, but it changes the trust boundary because Codex then readsOPENAI_API_KEYdirectly instead of staying behind the AWF proxy.So the remaining gap appears to be: there is still no supported way to keep AWF proxy-based credential isolation and force HTTP-only transport for a custom OpenAI-compatible provider.