🤖 feat: add ACP (Agent-Client Protocol) support for editor integration#2456
🤖 feat: add ACP (Agent-Client Protocol) support for editor integration#2456
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e12edb2352
ℹ️ 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 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 address that feedback".
70f72cd to
37ec5ee
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 264a9f2a5f
ℹ️ 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 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 address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 711af1d3c2
ℹ️ 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 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 address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a66b8a0a9
ℹ️ 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 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 address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48e01e8be7
ℹ️ 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 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 address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eaf8ccf2ce
ℹ️ 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 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 address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9bbd50d9b
ℹ️ 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 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 address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1b52ff1b5
ℹ️ 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 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 address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08c3967bef
ℹ️ 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 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 address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d67d1e598
ℹ️ 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 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 address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3116ddf2b0
ℹ️ 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 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 address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2efc6d3417
ℹ️ 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 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 address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e22c7d323a
ℹ️ 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 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 address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0c8567714
ℹ️ 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 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 address that feedback".
Add an ACP integration test that starts the built ACP CLI with --log-file, verifies initialize/newSession still work over stdio, checks ACP logs are written to the file, and ensures ACP-prefixed logs are not emitted to stderr in that mode. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$126.40`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=126.40 -->
Replace the fixed MAX_BUFFERED_CHAT_EVENTS overflow error with bounded upstream backpressure in runChatSubscription. The onChat drain loop now waits for queue capacity, and teardown explicitly releases waiters to avoid deadlocks. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$126.40`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=126.40 -->
Raise the per-test timeout for the new --log-file ACP CLI test to 15s so slower CI runners do not hit bun's default 5s test timeout while still validating log redirection behavior. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$126.40`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=126.40 -->
When stdout backpressure saturates the forwarding queue, keep draining onChat events so stream-end/abort/error can still resolve turns promptly. Non-terminal events are dropped once saturated to preserve liveness, and a regression test now covers high-volume saturation before terminal events. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$126.40`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=126.40 -->
Refine saturated-queue drop policy so only high-volume chunk/replay events are dropped. Lifecycle and control events (including caught-up and tool-call-end) continue to flow, preventing translator state corruption while still avoiding prompt hangs under heavy stdout backpressure. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$126.40`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=126.40 -->
Refine the backpressure drop set so message events are only droppable for replay traffic (replay=true). Live message events are now preserved to avoid losing real-time transcript updates while still allowing saturated replay streams to shed load. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$126.40`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=126.40 -->
Replace the fixed wall-clock turn timeout with an inactivity timeout that refreshes on correlated stream activity. This avoids false failures for long-running but active prompts while still preventing deadlocks when streams go silent. Added regression coverage proving active streams can run past the timeout window without being rejected. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$126.40`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=126.40 -->
Treat message events as droppable under saturation during replay catch-up (before caught-up) in addition to explicit replay=true events. This prevents full-history replays without replay flags from bypassing the saturation drop policy and growing the queue unboundedly under stdout backpressure. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$126.40`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=126.40 -->
Run disconnect-time stream interrupts before tracked-session eviction so session mappings remain available for every active turn. Also treat interruptStream success=false as an explicit disconnect cleanup failure signal (logged), and add regression tests covering multi-turn disconnect interruption ordering and backend interrupt failure handling. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$126.40`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=126.40 -->
In ToolRouter, only treat file_edit_insert read failures as create-file candidates when the error is explicit file-not-found; propagate other read failures instead. Added regression tests for not-found create behavior, guarded missing-file behavior, and non-not-found error propagation. In AIService delegated tool wrappers, remove abort listeners after each delegated call settles to avoid listener accumulation in long-running sessions. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$126.40`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=126.40 -->
Remove uncorrelated stream-start fallback matching to avoid binding active prompts to unrelated streams in shared workspaces. Prompt turns now bind stream-start only when acpPromptId matches, and tests were updated to require correlated terminal/start events where needed. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$126.40`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=126.40 -->
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ec8e37550
ℹ️ 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 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 address that feedback".
2ec8e37 to
440e24d
Compare
|
@codex review |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e825544017
ℹ️ 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 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 address that feedback".
Source ACP agent-mode config options from agents.list instead of a hardcoded list so Auto and other UI-selectable agents are surfaced. Also add a fallback to built-in definitions when partial test harness clients do not expose agents.list, and extend ACP config option tests to verify Auto visibility and ordering. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$127.46`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=127.46 -->
Guard runChatSubscription event handling by subscription token so stale onChat loops cannot process stream events after mode-switch/reconnect replacement. Also add a regression that simulates timed-out teardown with lingering stale events and verifies the active prompt is resolved only by the replacement stream. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$127.46`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=127.46 -->
|
@codex review Addressed the stale onChat subscription race by guarding per-event handling with the active subscription token, and added regression coverage for lingering stale stream events after timed-out teardown. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7505ef02e6
ℹ️ 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 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 address that feedback".
When a timed-out subscription teardown leaves an old onChat loop running, stop forwarding any buffered backlog once the subscription token is no longer current. This prevents stale replay/tool updates from being emitted after mode-switch/reconnect replacements and keeps live updates from the new stream from being delayed behind obsolete events. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$127.46`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=127.46 -->
|
@codex review Applied the queued-event filtering change so stale buffered onChat backlog is dropped once the subscription token is replaced. |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Add first-class ACP (Agent Client Protocol) support to Mux so external editors can create/manage sessions, send prompts, and receive structured live updates over ACP.
Background
This PR wires Mux into ACP as an editor-facing protocol surface (for clients like Zed/VS Code integrations), then hardens the integration for real-world streaming races and reconnect behavior.
Implementation
ACP surface area
mux acp) for local stdio ACP serving.Stability and correctness hardening
acpPromptIdmatching when available,Automode.Test coverage
Validation
bun test ./tests/ipc/acp.promptCorrelation.test.ts ./tests/ipc/acp.configOptions.test.ts ./tests/ipc/acp.sessionMethods.test.tsmake static-checkRisks
Primary risk area is ACP stream/event ordering under rare transport/reconnect races. This PR mitigates that with token-based subscription ownership checks and targeted regressions, but the area remains concurrency-sensitive and should be monitored in editor-integration rollouts.
Generated with
mux• Model:openai:gpt-5.3-codex• Thinking:xhigh• Cost:$127.46