Add opencode resume command

This commit is contained in:
Mohamed Boudra
2026-05-28 15:40:36 +07:00
parent f20393dbb7
commit 3baba543a4
2 changed files with 18 additions and 0 deletions
@@ -0,0 +1,15 @@
import { describe, expect, test } from "vitest";
import { buildProviderCommand } from "@/utils/provider-command-templates";
describe("buildProviderCommand", () => {
test("builds OpenCode resume commands from native session ids", () => {
expect(
buildProviderCommand({
provider: "opencode",
id: "resume",
sessionId: "ses_abc123",
}),
).toBe("opencode --session ses_abc123");
});
});
@@ -20,6 +20,9 @@ export const PROVIDER_COMMAND_TEMPLATES: Record<
pi: {
resume: "pi --session {sessionId}",
},
opencode: {
resume: "opencode --session {sessionId}",
},
};
function renderTemplate(template: string, vars: Record<string, string>): string {