From 9615803e3835246026c9fcf3cc2da2fce935c4d2 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sun, 22 Nov 2026 18:35:09 +0000 Subject: [PATCH 1/2] test(acp-registry): a local devin command answers plan approval without bypass Fails on main: isDevin only matches the registry agentId, so a local devin binary selects plan_bypass when the user accepts the plan. Co-Authored-By: Claude Opus 5.5 --- .../Adapters/AcpRegistryAdapterV2.test.ts | 191 +++++++++--------- 1 file changed, 100 insertions(+), 91 deletions(-) diff --git a/apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.test.ts b/apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.test.ts index 55b313a9d3adc..e78a9dd8af60d 100644 --- a/apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.test.ts +++ b/apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.test.ts @@ -2831,101 +2831,110 @@ describe("AcpRegistryAdapterV2", () => { }).pipe(Effect.provide(layerTest)), ); - it.effect("approves Devin's plan without choosing a bypass option it lists first", () => - Effect.gen(function* () { - const session = yield* openClaudeReplaySession( - [ - ...claudeFrames.open.map((entry) => - entry.frame.method === "initialize" && entry.type === "emit_inbound" - ? { - ...entry, - frame: { - ...entry.frame, - result: { protocolVersion: 1, agentCapabilities: {}, authMethods: [] }, - }, - } - : entry, - ), - { - type: "expect_outbound", - frame: { kind: "request", method: "session/prompt", params: "" }, - }, - claudeFrames.update(CLAUDE_ROOT_SESSION, { - sessionUpdate: "tool_call", - toolCallId: "exit-plan", - title: "Exit plan mode", - kind: "switch_mode", - status: "pending", - }), - { - type: "emit_inbound", - frame: { - kind: "request", - method: "session/request_permission", - params: { - sessionId: CLAUDE_ROOT_SESSION, - toolCall: { toolCallId: "exit-plan" }, - // Devin gives both plan approvals allow_once and does not promise their order. - options: [ - { - optionId: "plan_bypass", - name: "Yes, implement plan and bypass permissions", - kind: "allow_once", - }, - { - optionId: "plan_accept_edits", - name: "Yes, implement plan and accept edits", - kind: "allow_once", - }, - { optionId: "reject_once", name: "No, plan needs changes", kind: "reject_once" }, - ], + it.effect.each([ + ["registry", "devin"], + ["local", { source: "local", commandPath: "/opt/devin/bin/devin" }], + ] as const)( + "approves %s Devin's plan without choosing a bypass option it lists first", + ([, agent]) => + Effect.gen(function* () { + const session = yield* openClaudeReplaySession( + [ + ...claudeFrames.open.map((entry) => + entry.frame.method === "initialize" && entry.type === "emit_inbound" + ? { + ...entry, + frame: { + ...entry.frame, + result: { protocolVersion: 1, agentCapabilities: {}, authMethods: [] }, + }, + } + : entry, + ), + { + type: "expect_outbound", + frame: { kind: "request", method: "session/prompt", params: "" }, + }, + claudeFrames.update(CLAUDE_ROOT_SESSION, { + sessionUpdate: "tool_call", + toolCallId: "exit-plan", + title: "Exit plan mode", + kind: "switch_mode", + status: "pending", + }), + { + type: "emit_inbound", + frame: { + kind: "request", + method: "session/request_permission", + params: { + sessionId: CLAUDE_ROOT_SESSION, + toolCall: { toolCallId: "exit-plan" }, + // Devin gives both plan approvals allow_once and does not promise their order. + options: [ + { + optionId: "plan_bypass", + name: "Yes, implement plan and bypass permissions", + kind: "allow_once", + }, + { + optionId: "plan_accept_edits", + name: "Yes, implement plan and accept edits", + kind: "allow_once", + }, + { + optionId: "reject_once", + name: "No, plan needs changes", + kind: "reject_once", + }, + ], + }, }, }, - }, - { - type: "expect_outbound", - frame: { - kind: "response", - method: "session/request_permission", - result: { outcome: { outcome: "selected", optionId: "" } }, + { + type: "expect_outbound", + frame: { + kind: "response", + method: "session/request_permission", + result: { outcome: { outcome: "selected", optionId: "" } }, + }, }, - }, - { - type: "emit_inbound", - frame: { - kind: "response", - method: "session/prompt", - result: { stopReason: "end_turn" }, + { + type: "emit_inbound", + frame: { + kind: "response", + method: "session/prompt", + result: { stopReason: "end_turn" }, + }, }, - }, - claudeFrames.closeRequest, - claudeFrames.closed, - ], - undefined, - false, - "devin", - ); - yield* session.runtime.startTurn(session.turnInput(1)).pipe(Effect.forkScoped); - const seen = yield* session.until( - (event) => - event.type === "runtime_request.updated" && event.runtimeRequest.status === "pending", - ); - const request = seen.at(-1)!; - if (request.type !== "runtime_request.updated") throw new Error("Missing request"); - yield* session.runtime.respondToRuntimeRequest({ - requestId: request.runtimeRequest.id, - decision: "accept", - }); - let answer: unknown; - while (answer === undefined) { - const frame = (yield* Queue.take(session.outgoing)) as { - readonly result?: { readonly outcome?: { readonly optionId?: string } }; - }; - answer = frame.result?.outcome; - } - assert.deepEqual(answer, { outcome: "selected", optionId: "plan_accept_edits" }); - assert.equal((yield* session.terminal).status, "completed"); - }).pipe(Effect.provide(layerTest), Effect.scoped), + claudeFrames.closeRequest, + claudeFrames.closed, + ], + undefined, + false, + agent, + ); + yield* session.runtime.startTurn(session.turnInput(1)).pipe(Effect.forkScoped); + const seen = yield* session.until( + (event) => + event.type === "runtime_request.updated" && event.runtimeRequest.status === "pending", + ); + const request = seen.at(-1)!; + if (request.type !== "runtime_request.updated") throw new Error("Missing request"); + yield* session.runtime.respondToRuntimeRequest({ + requestId: request.runtimeRequest.id, + decision: "accept", + }); + let answer: unknown; + while (answer === undefined) { + const frame = (yield* Queue.take(session.outgoing)) as { + readonly result?: { readonly outcome?: { readonly optionId?: string } }; + }; + answer = frame.result?.outcome; + } + assert.deepEqual(answer, { outcome: "selected", optionId: "plan_accept_edits" }); + assert.equal((yield* session.terminal).status, "completed"); + }).pipe(Effect.provide(layerTest), Effect.scoped), ); it.effect("counts per-turn usage for a local glm command", () => From 582bb9f4a50a1540d4c63dbcadad31c6fc290685 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sun, 22 Nov 2026 18:38:57 +0000 Subject: [PATCH 2/2] fix(acp-registry): a local devin command gets Devin's handling isDevin only matched the registry agentId, which is empty for local commands, so a local devin binary got no client terminals, no Devin normalizers and no answerable-permission filter, and accepting its plan picked plan_bypass. Match the command basename like the other agents. Co-Authored-By: Claude Opus 5.5 --- packages/provider-acp-registry/src/server/adapter.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/provider-acp-registry/src/server/adapter.ts b/packages/provider-acp-registry/src/server/adapter.ts index 8eb5dbb30b8cc..102164bbc757a 100644 --- a/packages/provider-acp-registry/src/server/adapter.ts +++ b/packages/provider-acp-registry/src/server/adapter.ts @@ -196,7 +196,10 @@ export const makeAcpRegistryAdapterV2 = Effect.fn("makeAcpRegistryAdapterV2")(fu const registryAgentId = options.settings.source === "local" ? "" : options.settings.agentId; const startupKey = options.settings.source === "local" ? `local:${options.instanceId}` : registryAgentId; - const isDevin = registryAgentId === "devin"; + const isDevin = + registryAgentId === "devin" || + (options.settings.source === "local" && + /^devin(\.exe|\.cmd)?$/i.test(options.settings.commandPath.split(/[\\/]/).pop() ?? "")); const isAntigravityCli = options.settings.source === "local" && /^agy(\.exe|\.cmd)?$/i.test(options.settings.commandPath.split(/[\\/]/).pop() ?? "");