Skip to content

WIP: Websocket ACP wrapper - #350

Open
Ankur Goyal (ankrgyl) wants to merge 2 commits into
mainfrom
acp-prototype
Open

WIP: Websocket ACP wrapper#350
Ankur Goyal (ankrgyl) wants to merge 2 commits into
mainfrom
acp-prototype

Conversation

@ankrgyl

Copy link
Copy Markdown
Contributor

No description provided.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T06:14:25.534961Z bff9526 PR opened
ℹ️ About Codex in GitHub

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/acp.rs
Comment on lines +283 to +284
let socket = accept_hdr_async(stream, move |request: &Request, mut response: Response| {
if request.uri().path() != ACP_PATH {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread src/acp.rs
));
env.push((OsString::from("CODEX_BIN"), args.codex.clone()));
append_trace_environment(&mut env, base);
remove_braintrust_api_key = base.profile.is_some();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Latest downloadable build artifacts for this PR commit bff9526703b0:

Available artifact names
  • artifacts-build-global
  • artifacts-build-local-x86_64-apple-darwin
  • artifacts-build-local-aarch64-pc-windows-msvc
  • artifacts-build-local-x86_64-pc-windows-msvc
  • artifacts-build-local-x86_64-unknown-linux-musl
  • artifacts-build-local-x86_64-unknown-linux-gnu
  • artifacts-build-local-aarch64-apple-darwin
  • artifacts-build-local-aarch64-unknown-linux-gnu
  • artifacts-plan-dist-manifest
  • cargo-dist-cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant