Skip to content

Commit 04cb364

Browse files
fix(opencode): /goal clear with no goal set finishes as a no-op
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent ae27aaf commit 04cb364

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

  • packages/provider-opencode/src/server/v2

‎packages/provider-opencode/src/server/v2/adapter.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4488,11 +4488,18 @@ export const make = Effect.fn("OpenCode2Adapter.make")(function* (instanceId: Pr
44884488
const newest = yield* client.message.list({ sessionID, order: "desc", limit: 1 });
44894489
yield* markBefore(sessionId, newest.data[0]?.id ?? null);
44904490
if (!sending()) return;
4491-
yield* client.session.command({ sessionID, ...command });
44924491
if (goalCommand?.type === "pause" || goalCommand?.type === "clear") {
4493-
yield* finishControl;
4492+
// OpenCode rejects pausing or clearing a missing goal; Codex treats that as a no-op.
4493+
yield* client.session.command({ sessionID, ...command }).pipe(
4494+
Effect.catchIf(
4495+
(error) =>
4496+
error._tag === "CommandExecutionError" && error.message === "No goal is set.",
4497+
() => Effect.void,
4498+
),
4499+
);
4500+
return yield* finishControl;
44944501
}
4495-
return;
4502+
return yield* client.session.command({ sessionID, ...command }).pipe(Effect.asVoid);
44964503
}
44974504
}
44984505
const mentions = skillMentions(text);

0 commit comments

Comments
 (0)