The best way to control Claude Code, Codex and more from any computer or phone
fix(acp): forward empty plan replacements (#23440)
Aditya Garud committed
Oct 31, 2026 at 02:18 UTC
9522c7dd8f7050db198ee758e66bc62a146db1e5
2 files changed
+38
-11
packages/provider-acp/src/server/runtimeModel.test.ts
+29
@@ -329,6 +329,35 @@ describe("AcpRuntimeModel", () => {
329
).toBe(true);
330
});
331
332
+ it("forwards an empty ACP v1 plan to clear previous entries", () => {
333
+ const entries = [
334
+ [{ content: "Inspect state", priority: "high", status: "pending" }],
335
+ [],
336
+ ] as const;
337
+ const updates = entries.flatMap(
338
+ (plan) =>
339
+ parseSessionUpdateEvent({
340
+ sessionId: "session-1",
341
+ update: { sessionUpdate: "plan", entries: plan },
342
+ }).events,
343
+ );
344
+
345
+ expect(updates).toMatchObject([
346
+ {
347
+ _tag: "PlanUpdated",
348
+ payload: {
349
+ nativePlanId: "legacy",
350
+ kind: "items",
351
+ plan: [{ step: "Inspect state", status: "pending" }],
352
+ },
353
+ },
354
+ {
355
+ _tag: "PlanUpdated",
356
+ payload: { nativePlanId: "legacy", kind: "items", plan: [] },
357
+ },
358
+ ]);
359
+ });
360
+
361
it("projects typed ACP plan and content updates", () => {
362
const planResult = parseSessionUpdateEvent({
363
sessionId: "session-1",
packages/provider-acp/src/server/runtimeModel.ts
+9
-11
@@ -1392,17 +1392,15 @@ export function parseSessionUpdateEvent(params: EffectAcpSchema.SessionNotificat
1392
step: entry.content.trim().length > 0 ? entry.content.trim() : `Step ${index + 1}`,
1393
status: normalizePlanStepStatus(entry.status),
1394
}));
1395
- if (plan.length > 0) {
1396
- events.push({
1397
- _tag: "PlanUpdated",
1398
- payload: {
1399
- nativePlanId: "legacy",
1400
- kind: "items",
1401
- plan,
1402
- },
1403
- rawPayload: params,
1404
- });
1405
- }
1395
+ events.push({
1396
+ _tag: "PlanUpdated",
1397
+ payload: {
1398
+ nativePlanId: "legacy",
1399
+ kind: "items",
1400
+ plan,
1401
+ },
1402
+ rawPayload: params,
1403
+ });
1404
break;
1405
}
1406
case "plan_update": {