openpod

An opencode plugin that spins up a dedicated virtual machine for each session to isolate agent work.
git clone https://unitehenry.com/git/openpod.git
Log | Files | Refs | README

commit fa9f7c807ee35c51e74368bf951ba66c22d24717
parent 339823a30a6ad7eb4d983e2ed36cde97c95a185f
Author: Henry Unite <unitehenry@gmail.com>
Date:   Sun, 25 Oct 2026 20:25:08 +0000

test(opencode): should not create instance for uninitialized git origin

Add an E2E test for a git repo with no remote origin. The handler
returns early after logging "no origin remote configured". Verifies
no openpod directory and no lima instance are created.

Also renames the existing non-git test to start with "should" for
consistency.

Diffstat:
Mopencode.test.ts | 39++++++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/opencode.test.ts b/opencode.test.ts @@ -40,7 +40,7 @@ describe("opencode", () => { ).toBe(true); }); - it("not create openpod instance for uninitialized git repo", async () => { + it("should not create openpod instance for uninitialized git repo", async () => { // Create a temp directory that is not a git repo const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "openpod-e2e-")); @@ -77,4 +77,41 @@ describe("opencode", () => { // ignore cleanup failures } }); + + it("should not create openpod instance for uninitialized git origin", async () => { + // Create a temp directory and init a git repo (but no remote origin) + const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "openpod-e2e-")); + execSync("git init", { cwd: tempDir, stdio: "ignore" }); + + // Register the plugin and create a session, then move it to the git dir + await opencode.plugin(openpod); + const session = await opencode.sessions.create(); + + await opencode.sessions.move({ + sessionID: session.id, + directory: tempDir, + }); + + // Wait for the move to take effect + await new Promise((r) => setTimeout(r, 200)); + + // Trigger a prompt via the session API to fire the prompt hook. + await opencode.sessions.prompt({ + sessionID: session.id, + text: "hello", + }); + + expect(fs.existsSync(path.join(openpodRoot, session.id))).toBe(false); + + // Verify no lima instance was created for this session + const listOutput = execSync("limactl list", { encoding: "utf8" }); + expect(listOutput).not.toContain(session.id); + + // Clean up temp directory + try { + fs.rmSync(tempDir, { recursive: true, force: true }); + } catch { + // ignore cleanup failures + } + }); });