Skip to content

Merge branch 'main' into codex/feature-acp-integration

MacroscopeApp / Macroscope - Effect Service Conventions failed Sep 2, 2026 in 3m 23s

Effect Service Conventions: 4 issues found

The merge at this head consumes an AcpSessionRuntime service shape that no longer exists. 75ffa4f parked apps/server/src/provider/acp/AcpSessionRuntime.ts at upstream state and the follow-up merge 39ca2a5 never re-applied the ACP runtime changes, so the new driver and the generalized adapter call members and options that are absent from the service's public shape.

Findings (all posted inline):

  • apps/server/src/provider/Drivers/AcpDriver.ts:172 — runtime.connect() is not on AcpSessionRuntime["Service"]; the interface exposes initialize() and start() only.
  • apps/server/src/provider/Drivers/AcpDriver.ts:92 — AcpSessionRuntime.make requires authMethodId, which AcpAdapterProfile["makeRuntime"] omits and nothing re-supplies (same omission in the new makeTestAcpAdapter helper in Layers/CursorAdapter.test.ts).
  • apps/server/src/provider/Layers/CursorAdapter.ts:516 — ctx.acp.close is not a member of the runtime service; teardown is already owned by Scope.close(ctx.scope, ...).
  • apps/server/src/provider/Layers/CursorAdapter.ts:583 — onConfigOptionsChanged is not in AcpSessionRuntimeOptions and is silently dropped through a conditional spread, so ACP model discovery/refresh never fires.

The earlier finding on acp/AcpSessionRuntime.ts:577 (Effect.cached memoizing a failed handshake) is no longer applicable — that file is unchanged at this head. The earlier finding on acp/AcpAdapterSupport.ts:45 (untyped provider === "acp" plus magic -32000, remediation text concatenated onto the agent-supplied wire message) is unchanged and was not re-posted.

Details

Note

Your check run agent prompt is: .macroscope/check-run-agents/effect-service-conventions.md
More information about how Check Run Agents work can be found in our Help Center.

Methodology: compared the merge base 70cd258 with head 39ca2a5, then read the current contents of apps/server/src/provider/acp/AcpSessionRuntime.ts, apps/server/src/provider/acp/CursorAcpSupport.ts, apps/server/src/provider/Drivers/AcpDriver.ts, and apps/server/src/provider/Layers/CursorAdapter.ts at head to verify the service interface and options actually available to the new consumers.

Evidence at head 39ca2a5:

  • AcpSessionRuntime Context.Service interface members include initialize, start, getEvents, drainEvents, getModeState, getConfigOptions, prompt, cancel, setMode, setConfigOption, setModel, setSessionModel, request, notify — no connect, no close.
  • AcpSessionRuntimeOptions fields: spawn, cwd, resumeSessionId, sessionLoadTimeout, sessionLoadReplayIdleGap, clientCapabilities, clientInfo, authMethodId (required), mcpServers, requestLogger, protocolLogging — no onConfigOptionsChanged.
  • make(options: AcpSessionRuntimeOptions) and layer(options: AcpSessionRuntimeOptions) both take the full options object; makeCursorAcpRuntime supplies authMethodId: "cursor_login" internally, which is why the Cursor path is unaffected.

Items reviewed and not flagged: namespace import style in the new modules (* as Effect, * as AcpSessionRuntime, named imports from @t3tools/contracts) matches the conventions; makeUnsupportedTextGeneration returns via TextGeneration.of with the existing TextGenerationError operation discriminator, consistent with the surrounding module; selectAcpPermissionOptionId replaces the previous string-mapping helper without introducing a redundant wrapper.


🔍 Agent activity — 15 tool calls

💭 I'm comparing the current PR head against the prior reviewed commit to see what changed. The diff I'm seeing now seems smaller than expected—AcpSessionRuntime.ts doesn't appear in it, even though it was commented on in the prior run, so the diff scope might have shifted.

1. git_tools — 70cd258..39ca2a5

2. git_tools — 70cd258..39ca2a5

💭 Since AcpSessionRuntime.ts was reverted back to upstream state, my earlier comment about the Effect.cached concern on line 577 no longer applies — that file isn't part of the diff anymore. I should mark that thread as outdated and minimize it. My other finding about AcpAdapterSupport.ts:45 with the provider check and error code concatenation is still unchanged, so no need to repeat it. What concerns me now is whether reverting the runtime file broke compilation — things like runtime.connect(), close(), getConfigOptions, onConfigOptionsChanged, and AcpSessionRuntime.make with clientCapabilities may no longer exist if the file reverted to an older interface. I need to check the actual head state of AcpSessionRuntime.ts to confirm whether this is a real compile issue.

3. git_tools — 75ffa4f

4. git_tools — connect|getConfigOptions|onConfigOptionsChanged|Effect.cached|close

💭 I'm checking whether the merge commit actually re-applied the ACP runtime changes, but the grep at head shows connect is still missing from AcpSessionRuntime.ts — meaning the head branch is broken since AcpDriver still calls runtime.connect() and CursorAdapter calls ctx.acp.close. This seems out of scope for my check, which is focused on Effect service conventions rather than integration breaks, but it's still worth verifying: I need to confirm whether AcpSessionRuntimeOptions actually includes onConfigOptionsChanged and whether the service exposes start instead of connect, since passing a nonexistent field would be a compile error.

5. browse_code — apps/server/src/provider/acp/AcpSessionRuntime.ts

💭 I've confirmed the runtime only exposes initialize and start at head, with no connect or close methods. Now I want to check whether AcpSessionRuntimeOptions includes onConfigOptionsChanged and clientCapabilities.

6. browse_code — apps/server/src/provider/acp/AcpSessionRuntime.ts

💭 I'm confirming that the head branch's runtime options type is broken: it lacks onConfigOptionsChanged, connect, and close, and requires authMethodId even though the driver's makeRuntime never supplies it, which means the call to AcpSessionRuntime.make would fail type-checking. I'm also checking whether CursorAdapter.ts calling ctx.acp.close and passing onConfigOptionsChanged even compiles given the mismatched type, and whether collectSessionConfigOptionValues actually exists in AcpRuntimeModel at head — this looks like a genuine broken service contract between the driver/adapter and the runtime, not just a style nit, so it's worth flagging even though the review scope is nominally about conventions. I'll report this violation. Now I want to verify each claim precisely, starting with whether AcpRuntimeModel at head actually exports collectSessionConfigOptionValues.

7. git_tools — collectSessionConfigOptionValues|makeCursorAcpRuntime

8. git_tools — acp.close|runtime.connect|onConfigOptionsChanged

💭 Confirmed - consumers reference methods that don't exist on the parked runtime interface at head, and both AcpDriver and the CursorAdapter test call AcpSessionRuntime.make without the now-required authMethodId. I want to check the makeCursorAcpRuntime signature to confirm it doesn't accept the config options callback either.

9. browse_code — apps/server/src/provider/acp/CursorAcpSupport.ts

💭 I'm checking whether adding an onConfigOptionsChanged property to the input object would trigger an excess property error, since the runtime's input type likely omits certain fields and I need to verify how the spread would type-check. Actually, since TypeScript's excess property checks don't apply to spread expressions, the property probably wouldn't error at compile time — it would just be silently dropped, meaning the callback never gets passed to the runtime and ACP model discovery would silently fail to work. Meanwhile runtime.connect() and ctx.acp.close referencing nonexistent Service properties are clear compile errors. I also need to check whether AcpSessionRuntime.make requires authMethodId and whether make even exists as an exported function at head.

10. git_tools — ^export const (make|layer)|^export const make

💭 I'm confirming the type error: makeRuntime and its test helper both omit authMethodId when constructing the runtime options, which breaks since AcpSessionRuntimeOptions requires it. This looks like one of three integration breaks caused by the "park runtime at upstream state" commit not being followed up properly. This falls within my review scope—consuming members not on the service's public shape violates the service-boundary convention, so I'll flag it as a single finding across the affected call sites. I need to pin down exact line numbers: runtime.connect() in AcpDriver.ts (around line 172), and ctx.acp.close in CursorAdapter.ts (around lines 516 and 582-583), so I'm checking the actual files to confirm placement before leaving inline comments.

11. browse_code — apps/server/src/provider/Drivers/AcpDriver.ts

12. browse_code — apps/server/src/provider/Drivers/AcpDriver.ts

💭 I need to double-check specific line ranges in CursorAdapter to verify those sections.

13. browse_code — apps/server/src/provider/Layers/CursorAdapter.ts

💭 All confirmed, so now I can write up the findings. The first issue is in AcpDriver.ts around lines 172 and 92: it calls a connect() method that doesn't actually exist on the AcpSessionRuntime service's current interface (which only exposes initialize() and start()), and also passes a make call requiring authMethodId that gets stripped by an Omit type and never re-supplied. This looks like it was introduced by a merge conflict. The second issue is in CursorAdapter.ts:516, where ctx.acp.close is called but isn't part of the service interface. The third is at CursorAdapter.ts:582, where onConfigOptionsChanged isn't included in AcpSessionRuntimeOptions, so it gets silently dropped during a spread (since there's no excess-property checking on spreads) — meaning AcpDriver's callback never fires and model discovery/refresh breaks; the same missing field also affects AcpAdapterProfile.makeRuntime's input type. I'm now deciding how to present these as inline review comments — whether to combine the two AcpDriver.ts issues (lines 92 and 172) into one comment since they're related, or keep them separate to avoid noise. I'm leaning toward consolidating into a single comment spanning that range. I'll settle on three total comments: one on AcpDriver.ts covering both the missing authMethodId in make and the missing connect, one on CursorAdapter.ts:516 for the missing close, and one on CursorAdapter.ts:583 for the silently dropped onConfigOptionsChanged. I also note the test helper has the same missing authMethodId issue, worth mentioning in that first comment. For fixes, the real solution is re-applying the parked AcpSessionRuntime changes across files, though that's not something a simple diff comment can capture, and the authMethodId fix isn't straightforward either. I also want to check whether my earlier comment on AcpSessionRuntime.ts:577 is now stale since that file isn't part of the current changes, so I might mark it outdated — I'll need to fetch its node ID from the review comments first. The AcpAdapterSupport comment, though, is still valid since that code hasn't changed. Let me pull the list of review comments now.

14. github_api_read_only — repos/{owner}/{repo}/pulls/{pull_number}/comments

💭 The old AcpSessionRuntime comment is already marked stale, so I don't need to touch it. Now I want to post my new findings as inline comments — the real issue is that AcpDriver.ts calls connect() on something that isn't the service, and there's a missing authMethodId around lines 92-102. I'll keep each comment short and precise, starting with the line 172 issue. At this commit, the runtime service only exposes initialize() and start(), not connect() — that member was reverted by 75ffa4f and never restored, so the probe doesn't actually type-check; I need to either re-apply the runtime changes or rework the probe to use initialize() and adjust for its response shape. Next, AcpSessionRuntime.make requires an authMethodId that AcpAdapterRuntimeFactory never supplies, so I need to provide an explicit one for the generic profile and update the test helper accordingly. Then there's a similar problem in CursorAdapter.ts where it calls close on the runtime service, which doesn't exist there either since teardown already handles closing elsewhere. I'm also noticing a subtler issue: onConfigOptionsChanged is passed into the runtime options object through a conditional spread, which TypeScript's excess-property checking doesn't catch since spread-introduced properties are exempt from that check — so the option gets silently dropped instead of erroring, meaning model-discovery refresh never actually fires. I need to either add this option properly to the runtime service's options type and thread it through, or remove it from the adapter profile entirely. I'll write up the review with four inline comments covering these findings, all on the RIGHT side of the diff at their respective lines, plus a short cross-cutting note in the body about the parked commit being the root cause — without duplicating the inline details there.

15. modify_pr — Root cause note for the four inline findings: 75ffa4f ("park runtime and mock agent at upstream state before merging main") reverted apps/server/src/provider/acp/AcpSessionRuntime.ts to upstream, and the follow-up merge 39ca2a5 never re-applied the ACP runtime changes. The new consumers (Drivers/AcpDriver.ts, makeAcpAdapter) are therefore written against a service shape that does not exist at this head: AcpSessionRuntime["Service"] has no connect or close, and AcpSessionRuntimeOptions has neither onConfigOptionsChanged nor an optional authMethodId.


Agent Credits: 182 credits

Token usage: 24 uncached input · 1,105,820 cache-read input · 141,863 cache-write input · 11,564 output
Agent Credits may also include non-token charges from external tools such as web research.