WIP: Websocket ACP wrapper - #350
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bff9526703
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| let socket = accept_hdr_async(stream, move |request: &Request, mut response: Response| { | ||
| if request.uri().path() != ACP_PATH { |
There was a problem hiding this comment.
Validate browser origins before accepting ACP sockets
When the server runs in its only supported --no-auth loopback mode, a malicious webpage can open a WebSocket to ws://127.0.0.1:5001/acp and send ACP commands under the user's permissions. Binding to loopback does not prevent browser-originated requests, and this handshake callback checks only the path while accepting every Origin; reject untrusted browser origins or require an unguessable credential before launching Codex.
Useful? React with 👍 / 👎.
| )); | ||
| env.push((OsString::from("CODEX_BIN"), args.codex.clone())); | ||
| append_trace_environment(&mut env, base); | ||
| remove_braintrust_api_key = base.profile.is_some(); |
There was a problem hiding this comment.
Preserve API-key precedence in the trace shim
When both BRAINTRUST_PROFILE and BRAINTRUST_API_KEY are set in the environment, profile_explicit is false and the normal auth path intentionally gives the API key precedence, but this condition removes the key merely because the profile environment variable populated base.profile. Consequently bt acp codex --trace --no-auth silently switches credentials—or fails if that ambient profile is stale—rather than preserving the CLI-owned selection; only remove the key for an explicit/preferred profile or pass the resolved auth choice to the shim.
AGENTS.md reference: AGENTS.md:L9-L9
Useful? React with 👍 / 👎.
|
Latest downloadable build artifacts for this PR commit
Available artifact names
|
No description provided.