Skip to content

feat(providers): standardize ACP providers - #6461

Open
StiensWout wants to merge 286 commits into
pingdotgg:t3code/codex-turn-mappingfrom
StiensWout:t3code/acp-registry-search-install
Open

feat(providers): standardize ACP providers#6461
StiensWout wants to merge 286 commits into
pingdotgg:t3code/codex-turn-mappingfrom
StiensWout:t3code/acp-registry-search-install

Conversation

@StiensWout

@StiensWout StiensWout commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Generic ACP support on orchestrator v2 still depended on provider-specific assumptions. Registry agents could install and launch, but protocol generations, request identity, MCP access, authentication, session replay, and client presentation did not share one reliable boundary.

This PR makes ACP Registry agents first-class providers through the generic orchestrator v2 path.

What changed

  • Adds environment-aware ACP Registry search, exact-version preparation, provider instances, status, session import, logout, and cleanup.
  • Installs Registry npx and uvx packages globally so their normal commands are available in fresh server terminals. Registry binaries stay in the managed, checksum-aware cache.
  • Preserves exact JSON-RPC request identity across core and extension methods.
  • Gives every ACP provider the same authenticated MCP bridge, scoped fallback, session configuration, interaction instructions, permission policy, response lifecycle, stop behavior, and checkpoint replacement behavior.
  • Projects ACP models, config options, modes, commands, skills, messages, tool calls, usage, plans, compaction, session metadata, and agent-owned terminals into the standard T3 surfaces.
  • Carries Registry identity into mobile model catalogs, composer controls, new-task controls, and thread rows, with allowlisted official icons and a generic fallback.
  • Keeps Registry providers out of app-owned text generation such as titles, branch names, commits, and pull request copy.

Protocol compatibility

effect-acp now generates and pins both protocol surfaces:

  • preferred unstable schema: schema-v2.0.0-alpha.3
  • Registry compatibility schema: schema-v1.21.0

Initialization advertises both generations and selects the wire implementation from the response shape. This is required in practice: pi-acp@0.0.33 returns the v1 shape with protocol value 1, while Google Antigravity returns the v1 shape with protocol value 2. After negotiation, v1 and v2 use separate method and lifecycle handlers behind one provider-neutral client.

ACP v2 adds accepted-prompt plus idle-state completion, authoritative message upserts, usage and session metadata, rich plan updates, config changes, compaction, and agent-owned terminal state. V1 Registry agents keep their existing prompt response, session load, client filesystem, and client terminal behavior.

Runtime and security boundary

  • Package agents are globally installed at the exact Registry version. The writable user-global prefix is used when the system prefix is unavailable.
  • Managed binaries use platform and architecture selection, HTTPS download constraints, optional SHA-256 verification, atomic publication, and bounded probes.
  • Provider-instance configuration and secrets update atomically.
  • T3 mediates ACP permission requests and v1 client filesystem and terminal calls, but it cannot sandbox tools an agent executes inside its own process.
  • Checkpoint rollback restores the workspace and replaces the native ACP session because ACP has no conversation truncation method.

Live proof

Pi through generic ACP

Fresh global install of pi-acp@0.0.33, provider creation, model discovery, completed T3 turn, and global command verification:

Pi ACP proof

Google Antigravity through generic ACP

Registry discovery, binary download, provider creation, live ACP handshake, and Google authentication boundary:

Google Antigravity ACP proof

The Antigravity test host was deliberately cleared of Google credentials. The proof therefore ends at the correctly advertised Log in with Google state instead of claiming an authenticated model turn.

Full parity matrix and prioritized generic ACP gaps

Verification

  • 45 effect-acp assertions passed.
  • 173 focused server and adapter assertions passed.
  • effect-acp and server TypeScript checks passed.
  • Schema generation completed from both pinned official releases.
  • Changed-file formatting and git diff --check passed.
  • Live Pi Registry install, global command, model selection, and completed turn passed.
  • Live Antigravity Registry download, executable launch, protocol negotiation, and unauthenticated provider state passed.

Authentication credentials remain owned by each agent and user. T3 does not store or automate generic provider credentials.

Built with GPT-5.6 Sol in T3 Code through the Codex harness.


Note

High Risk
Touches ACP protocol, authenticated MCP bridging, binary download/provisioning, and orchestration auth scopes. A regression can break agent sessions, leak credentials, or install untrusted binaries.

Overview
Adds first-class ACP Registry providers (search, prepare/install, session import, logout) and standardizes the orchestrator-v2 ACP boundary so generic agents no longer depend on per-provider hacks.

Registry discovery is read-scoped; prepare, uninstall, URL auth, import, and logout require operate. Icons are allowlisted to the official Registry CDN. Mobile catalogs, composers, and thread rows now show registry identity with a cached icon and generic ACP fallback.

ACP sessions inject an authenticated stdio MCP bridge (t3 acp-mcp-bridge / acp-mcp-call) so agents that only speak stdio MCP still reach T3 tools. bin.ts fast-paths those commands before the full CLI graph loads. The mock agent and effect-acp move to protocol v2 (configId, tool_call_update/plan_update, state_update idle, elicitation/permission subject shapes).

Also warms checkpoint object hashing in the background so the first capture does not block first-message latency, and appends managed ACP binaries to the integrated terminal PATH.

Reviewed by Cursor Bugbot for commit 30466f3. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add acpRegistry provider driver with catalog, v2 protocol, and session management

  • Introduces a new acpRegistry built-in driver backed by an AcpRegistryCatalog service supporting search, prepare, inspect, resolve, and managed-binary uninstall with size-bounded, checksum-verified downloads and global package install receipts
  • Migrates effect-acp to ACP protocol v2 (schema-v2.0.0-alpha.3) with a v1.21 compatibility layer; the client negotiates generation on initialize and normalizes all subsequent RPCs and notifications
  • Adds AcpRegistryRuntimeCoordinator to arbitrate foreground vs. background probes per agent and stream live available commands, session configuration, and URL-auth actions into provider snapshots
  • Exposes new WebSocket RPCs (searchAcpRegistry, prepareAcpRegistryAgent, uninstallAcpRegistryManagedBinary, acceptAcpRegistryUrlAuth, listAcpRegistrySessions, importAcpRegistrySession, logoutAcpRegistry) and atomic ProviderInstanceMutation (create/upsert/remove) with transactional settings persistence and secret rollback in serverSettings.ts\n- Ships web and mobile UI for registry search, identity wizard, ACP icon rendering with caching, session import/logout, URL-based auth acceptance, and context-window cost display; adds isProviderInstanceTextGenerationCapable gating across settings and model selection so non-text-generation instances are hidden
  • Adds acp-mcp-bridge and acp-mcp-call CLI fast paths in bin.ts to proxy T3's MCP endpoint over stdio for ACP agents without loading the full CLI
  • Risk: AcpSessionRuntime removes setSessionModel; callers in GrokTextGeneration.ts and GrokAcpSupport.ts no longer set a base model. AcpClient handler signatures now require an AcpRequestContext argument on all core and extension handlers. session/load is replaced by session/resume with replayFrom semantics. Out-of-tree consumers of effect-acp client/agent APIs will break.

Macroscope summarized 30466f3.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: afe3036c-50e9-478c-9d70-31d912377ac1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Aug 13, 2026

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the new/changed Effect services in this PR (AcpRegistryCatalog, AcpRegistryRuntimeCoordinator, the ACP Registry driver/probe, and their call sites). Four convention issues, all in ACP Registry code introduced here.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/ws.ts Outdated
Comment thread apps/server/src/provider/acp/AcpRegistryRuntimeCoordinator.ts Outdated
Comment thread apps/server/src/provider/acp/AcpRegistrySupport.ts Outdated
Comment thread apps/server/src/provider/acp/AcpRegistrySupport.ts Outdated
Comment thread apps/server/src/provider/acp/AcpRegistrySupport.ts Outdated
Comment thread apps/web/src/components/settings/ProviderInstanceCard.tsx Outdated
Comment thread apps/server/src/provider/acp/AcpRegistrySupport.ts Outdated
Comment thread apps/server/src/ws.ts Outdated
Comment thread packages/contracts/src/acpRegistry.ts
Comment thread apps/server/src/provider/acp/AcpRegistryProbe.ts Outdated
Comment thread apps/web/src/components/settings/AcpRegistryIcon.tsx Outdated
StiensWout added a commit to StiensWout/t3code that referenced this pull request Aug 13, 2026
Address the Macroscope review round on pingdotgg#6461 (fail-closed archive
listings, linear download buffering, normalized probe fields, inline
service shapes, restored accent badges, honest uninstall errors) and
extend the generic ACP runtime with the capabilities live testing
surfaced:

- advertise and implement the ACP client fs and terminal capabilities,
  including embedded terminal output in tool calls
- map session config options and modes onto provider option descriptors;
  collapse legacy model-effort variants onto base models and drive
  agent collaboration modes from T3's own Plan/Build toggle
- compose runnable terminal-auth commands and env-var guidance for
  advertised authentication methods
- cache successful discovery probes, raise the probe timeout for cold
  npx starts, and soften probe failures to warnings
- replace stale ACP model inventories on completed probes instead of
  retaining them forever through the snapshot cache
- implement checkpoint rollback for ACP threads with reset semantics
- bridge T3's MCP endpoint over stdio (t3 acp-mcp-bridge) so every ACP
  agent receives the t3-code orchestration toolkit; live testing proved
  injected http servers never connected
- fall back to native image loading for registry icons (the official
  CDN sends no CORS headers) and degrade rejected config-option values
  instead of failing the session open

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@StiensWout
StiensWout force-pushed the t3code/acp-registry-search-install branch from a23c9c5 to 44704f5 Compare August 13, 2026 21:41
@StiensWout StiensWout changed the title [WIP] feat(providers): add ACP Registry search and install feat(providers): standardize ACP providers Aug 13, 2026
@StiensWout
StiensWout marked this pull request as ready for review August 13, 2026 21:41
@StiensWout
StiensWout force-pushed the t3code/acp-registry-search-install branch from 44704f5 to ac3b3a7 Compare August 13, 2026 21:42

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two Effect service convention issues in the new ACP service code. Everything else (inline Context.Service interfaces, AcpRegistryCatalog["Service"] / AcpRegistryRuntimeCoordinator["Service"] references, removal of the makeAcpRegistryResolver alias, environment-acquired catalog/coordinator in the driver) matches the conventions.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/provider/acp/AcpRegistryRuntimeCoordinator.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts Outdated
Comment thread apps/server/src/provider/acp/AcpSessionConfig.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts
Comment thread apps/server/src/server.ts
Comment thread apps/server/src/provider/acp/AcpSessionConfig.ts Outdated
Comment thread apps/server/src/provider/acp/AcpRegistrySupport.ts Outdated
Comment thread apps/server/src/provider/acp/AcpClientTerminals.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts
Comment thread apps/server/src/mcp/AcpMcpStdioBridge.ts Outdated
Comment thread apps/server/src/provider/acp/AcpRegistryProbe.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Effect service conventions: two findings in the new ACP code. The earlier review round's items (standalone *Shape interfaces, the makeAcpRegistryResolver compatibility alias, and the detail-copies-cause.message wrapper in ws.ts) are resolved on this head.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts Outdated
Comment thread apps/server/src/provider/Drivers/AcpRegistryDriver.ts Outdated
Comment thread apps/server/src/provider/acp/AcpClientTerminals.ts Outdated
Comment thread apps/server/src/provider/acp/AcpClientTerminals.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts Outdated
Comment thread apps/web/src/components/settings/AcpRegistryIcon.tsx Outdated
Comment thread apps/server/src/provider/acp/AcpSessionConfig.ts Outdated
Comment thread apps/server/src/mcp/AcpMcpStdioBridge.ts Outdated
Comment thread apps/server/src/serverSettings.ts
Comment thread apps/web/src/components/settings/AddProviderInstanceDialog.tsx Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts
@macroscopeapp

macroscopeapp Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This XXL PR introduces a new ACP Registry provider, third-party provisioning, authenticated MCP bridging, protocol compatibility, session lifecycle, terminal, settings, and orchestration behavior across server, web, mobile, contracts, and a shared package. The breadth and security-sensitive runtime effects, together with unresolved substantive protocol and orchestration concerns, require human review.

Not approved because:

  • 3 blocking correctness issues found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

Comment thread apps/server/src/ws.ts

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the ACP service/error changes against the Effect service conventions.

One new finding this round (duplicated private schema predicate in ws.ts). Two previously flagged violations are still present and unchanged, so I have not re-commented on them:

  • apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts:4667-4676 — single known tagged failure recovered with Effect.catch + manual _tag check and Effect.fail(error) re-raise; convention is Effect.catchTags({ AcpRequestError: ... }).
  • apps/server/src/provider/Drivers/AcpRegistryDriver.ts:537 — wrapper detail is built from cause.message while cause is already preserved; use the stable phrase form used by the sibling drivers.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/ws.ts Outdated
Comment thread apps/server/src/provider/acp/AcpRegistrySupport.ts Outdated
Comment thread apps/server/src/provider/acp/AcpClientTerminals.ts Outdated
Comment thread packages/effect-acp/src/protocol.ts Outdated
Comment thread apps/server/src/mcp/AcpMcpStdioBridge.ts Outdated
Comment thread apps/server/src/provider/acp/AcpClientTerminals.ts
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts
Comment thread apps/server/src/provider/acp/AcpClientTerminals.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts Outdated
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts
Comment thread apps/server/src/provider/acp/AcpClientPolicy.ts Outdated
Comment thread packages/contracts/src/orchestrationV2.ts Outdated
Comment thread apps/server/src/provider/acp/AcpClientPolicy.ts
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts
Comment thread apps/server/src/provider/acp/AcpRuntimeModel.ts
Comment thread apps/server/src/provider/acp/AcpRegistrySupport.ts
Comment thread apps/server/src/provider/acp/AcpRegistrySupport.ts

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One finding in the new ACP MCP stdio bridge: the error wrapper flattens the underlying failure into a message string instead of preserving it as cause.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/mcp/AcpMcpStdioBridge.ts Outdated
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 2 times, most recently from 519c42a to 4c55679 Compare August 17, 2026 10:28
@StiensWout

Copy link
Copy Markdown
Contributor Author

[gpt-5.6-sol] RESPONDING ON BEHALF OF WOUT:

Generic ACP proof

Pi and Google Antigravity are both configured through the same official ACP Registry and orchestrator V2 path. The live Antigravity prepare streamed and installed the 543,411,011-byte Google-hosted archive; no agent-specific integration code was added.

Pi and Antigravity via ACP

Latest commit: d54c3cb

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

UI consistency review: two new settings surfaces reconstruct shared primitives locally. Earlier findings on this PR (ScrollArea usage, radius tokens, DialogPanel, registry icon forwarding to the command palette and provider card) look resolved.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/AcpSessionManagementSection.tsx Outdated
Comment thread apps/web/src/components/settings/AcpRegistrySearchStep.tsx Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Effect service conventions: one finding on the ACP Registry session-management path. Everything else in the ACP Registry service surface (inline Context.Service interfaces, exported make/layer, exported isAcpRegistryError, Effect.catchTags, snapshot error attributes) matches the conventions.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/provider/acp/AcpRegistryProbe.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two Effect service convention issues in the new ACP Registry code. Everything else in the changed service scope (the AcpRegistryCatalog / AcpRegistryRuntimeCoordinator definitions, their make/layer exports, and the driver wiring) reads as conformant.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/provider/acp/AcpRegistryProbe.ts Outdated
Comment thread packages/contracts/src/acpRegistry.ts
Comment thread apps/server/src/provider/Drivers/AcpRegistryDriver.ts
Comment thread apps/server/src/provider/Drivers/AcpRegistryDriver.ts
@StiensWout

Copy link
Copy Markdown
Contributor Author

[gpt-5.6-sol] RESPONDING ON BEHALF OF WOUT:

Macroscope UI Consistency is a stale-mirror false positive on head 8813201. The check is attached to 8813201, but its own activity/output says it reviewed only 2d623ac..4cea350. At the actual head, AcpSessionManagementSection.tsx uses the shared Select/SelectTrigger primitives and contains no raw <select>, while AcpRegistrySearchStep.tsx uses InputGroup/InputGroupAddon/InputGroupInput. Both prior findings were fixed in 8166aad. A suite re-request through GitHub was attempted after completion, but GitHub returned 404 because this contributor token cannot rerun the base repository’s third-party Checks app.

Comment thread apps/server/src/provider/Drivers/AcpRegistryDriver.ts Outdated
@StiensWout

Copy link
Copy Markdown
Contributor Author

Global-package boundary proof on 838f32631:

  • Fresh ACP Registry preparation of gemini returned { agentId: "gemini", version: "0.56.0", distribution: "npx", prepared: true }.
  • The system npm prefix on this VPS is read-only, so the generic fallback installed the exact package into the writable user-global prefix.
  • command -v gemini resolved /home/t3/.local/bin/gemini.
  • gemini --version returned 0.56.0.
  • npm list --global --prefix /home/t3/.local @google/gemini-cli --depth=0 reported @google/gemini-cli@0.56.0.
  • Focused ACP catalog and driver suite: 36 assertions passed. Server typecheck and changed-file lint/format/diff checks passed.

This complements the uploaded Pi + Antigravity proof above. Package-based Registry agents now install globally during prepare and ACP launches the exposed command directly, with no npx or uvx runner cache at session startup.

Comment thread apps/server/src/provider/acp/AcpRegistrySupport.ts Outdated
Comment thread apps/server/src/provider/acp/AcpRegistrySupport.ts Outdated
Comment thread apps/server/src/provider/acp/AcpRegistrySupport.ts
Comment thread apps/server/src/provider/acp/AcpRegistrySupport.ts
Comment thread apps/server/src/provider/acp/AcpRegistryProbe.ts
@StiensWout

Copy link
Copy Markdown
Contributor Author

Macroscope UI Consistency is a stale false positive on 874307b31: its output says it analyzed 4cea350, then repeats two findings already marked “No longer relevant as of 8166aad.” At the current head, AcpSessionManagementSection uses the shared Select primitives and AcpRegistrySearchStep uses InputGroup/InputGroupAddon/InputGroupInput. No code change is needed for either reported item.

type: "diff" as const,
path: change.path,
...(change.operation === "add" ? { oldText: null } : {}),
newText: patch,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium src/client.ts:336

V2 diff updates expose unified patch syntax as newText, so consumers treat the patch itself as the complete file contents and render incorrect file changes. This also repeats the same whole patch for every entry in changes; derive per-file replacement content or avoid mapping unsupported patch data into newText.

🤖 Copy this AI Prompt to have your agent fix this:
In file @packages/effect-acp/src/client.ts around line 336:

V2 `diff` updates expose unified patch syntax as `newText`, so consumers treat the patch itself as the complete file contents and render incorrect file changes. This also repeats the same whole patch for every entry in `changes`; derive per-file replacement content or avoid mapping unsupported patch data into `newText`.

);
}
if (notification.update.sessionUpdate === "config_option_update") {
yield* Ref.set(configOptionsRef, notification.update.configOptions);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium acp/AcpSessionRuntime.ts:1636

A failed session/load leaves configOptionsRef containing the candidate session's config_option_update values, so subsequent setConfigOption calls validate against or short-circuit using the wrong session's configuration. The gate branch updates this shared ref before the load outcome is known; snapshot and restore the active session's options on failure, or isolate candidate-session updates until adoptSession succeeds.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/provider/acp/AcpSessionRuntime.ts around line 1636:

A failed `session/load` leaves `configOptionsRef` containing the candidate session's `config_option_update` values, so subsequent `setConfigOption` calls validate against or short-circuit using the wrong session's configuration. The gate branch updates this shared ref before the load outcome is known; snapshot and restore the active session's options on failure, or isolate candidate-session updates until `adoptSession` succeeds.

if (update.sessionUpdate === "terminal_output_chunk") {
return {
...current,
output: `${current.output}${Buffer.from(update.data, "base64").toString("utf8")}`.slice(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium acp/AcpRuntimeModel.ts:79

applyAcpAgentTerminalUpdate permanently corrupts terminal output when a multibyte UTF-8 character is split across terminal_output_chunk updates: each chunk is decoded independently, producing replacement characters instead of the original character. Preserve undecoded bytes between chunks or use a streaming UTF-8 decoder for the terminal state.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/provider/acp/AcpRuntimeModel.ts around line 79:

`applyAcpAgentTerminalUpdate` permanently corrupts terminal output when a multibyte UTF-8 character is split across `terminal_output_chunk` updates: each chunk is decoded independently, producing replacement characters instead of the original character. Preserve undecoded bytes between chunks or use a streaming UTF-8 decoder for the terminal state.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 30466f3. Configure here.

update.sessionUpdate === "user_message" ? "user" : "assistant",
text,
true,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Subagent messages blocked by gate

High Severity

projectSubagentNotification now projects ACP v2 agent_message upserts for child sessions, but the foreign-session gate still admits only agent_message_chunk. Authoritative child-session messages never reach that handler, so subagent assistant text from v2 agents is dropped.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 30466f3. Configure here.

: modeChoices.find((choice) => choice === "code" || choice === "default");
if (requestedMode !== undefined && modeOption.currentValue !== requestedMode) {
yield* runtime.setConfigOption(modeOption.id, requestedMode);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Build forces code mode

Medium Severity

The new config mode mapping treats non-plan interaction as code or default only. That disagrees with the existing modes-API path, which leaves the agent default alone for Build. Agents that advertise mode as a config option are switched out of ask on every Build open, changing their native permission behavior.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 30466f3. Configure here.

update.sessionUpdate === "user_message" ? "user" : "assistant",
text,
true,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Replay ignores plan updates

Medium Severity

During session load/replay, only legacy plan clears the loading message boundary. ACP v2 plan_update and plan_removed fall through, so later history chunks can keep concatenating onto the previous role instead of starting a new history item after a plan boundary.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 30466f3. Configure here.

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

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants