refactor(acp): keep protocol implementation exports private#10165

merged2
main
cleanup-packages/acp-internals
openedSep 5, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 3d ago

The private ACP package exports individual RPC definitions and implementation helpers that no repository consumer imports.

Keep those definitions local and remove the unused client layer wrapper. The live client factory, child-process layer, agent constructor/layers, and RPC groups remain exported. The agent constructor has a local @public explanation because the repository's Effect service convention requires public construction APIs. Generated upstream protocol definitions are untouched.

Verification on the integrated stack:

  • ACP Knip export scan passes.
  • All 40 existing ACP tests pass.
  • ACP typecheck, targeted lint, and formatting pass.

No tests or runtime protocol behavior changed. This is the first cleanup layer; #10171 enforces exports across all seven internal packages.

Model: gpt-6 astra. Harness: Codex in T3 Code.

Added 1 commit

  • refactor(acp): keep protocol implementation exports private9fecf16
Synced from GitHub

Approvability

Verdict: Approved at 913f038

Macroscope's review found this PR approvable — This is a localized private-API cleanup that hides implementation details without changing ACP protocol behavior or existing in-repository call paths. The only removed helper is an unused client layer wrapper, while the supported factories and RPC groups remain available.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire13.6 KiB13.6 KiB+2 B (+0.0%)15.1 KiB✅
CodexThread snapshot wire7.0 KiB7.0 KiB+1 B (+0.0%)7.3 KiB✅
CodexLive turn WebSocket wire6.6 KiB6.6 KiB+1 B (+0.0%)7.8 KiB✅
CodexLive turn WebSocket decoded57.1 KiB57.1 KiB0 B (0.0%)66.4 KiB✅
CodexLive turn messages10100 (0.0%)21✅
ClaudeTotal thread wire13.6 KiB13.5 KiB−12 B (−0.1%)15.1 KiB✅
ClaudeThread snapshot wire7.0 KiB7.0 KiB+4 B (+0.1%)7.3 KiB✅
ClaudeLive turn WebSocket wire6.5 KiB6.5 KiB−16 B (−0.2%)7.8 KiB✅
ClaudeLive turn WebSocket decoded57.8 KiB57.8 KiB−44 B (−0.1%)66.4 KiB✅
ClaudeLive turn messages98−1 (−11.1%)21✅

Baseline: 62ed748 · PR result: 913f038 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

packages/effect-acp/src/agent.tsline 257Outdated · 9fecf16Open thread
……@@ -254,7 +254,7 @@ interface AcpCoreAgentRequestHandlers {
255255const decodeCancelNotification = Schema.decodeUnknownEffect(AcpSchema.CancelNotification);
256256
257-export const make = Effect.fn("effect-acp/AcpAgent.make")(function* (
257+const make = Effect.fn("effect-acp/AcpAgent.make")(function* (
MmacroscopeappBoton line 257Sep 5, 2026

src/agent.ts:257

agent.ts owns construction of the AcpAgent service, so make should stay part of the module's public shape alongside layer/layerStdio (the sibling client.ts still exports its make). Consumers that need to build an agent inside an existing scope rather than via a layer lose that entry point here. Consider keeping the export:

suggestion
1export const make = Effect.fn("effect-acp/AcpAgent.make")(function* (

No longer relevant as of 913f03875dda49579b78d72ec85471b5c3ad2b7f

Restored the public agent constructor in 913f038. The adjacent @public comment explains that construction is part of the canonical Effect module API. The expanded Knip check passes with the constructor retained.

Added 1 commit

  • refactor(acp): retain the public service constructor913f038