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 180ea15480136709e1999b03fd93e7f8602a8f97
parent 00a17868b42cb7f7f8715455e70e1830383e301f
Author: Henry Unite <unitehenry@gmail.com>
Date:   Mon, 26 Oct 2026 16:48:31 +0000

revert: remove limactl debug logging

CI now passes with the lima-actions setup, so the temporary stderr logging added in 4f34f65 and 6648ac1 is no longer needed.

Diffstat:
Mprompt/handle.test.ts | 8++++----
Mprompt/handle.ts | 78+++++++-----------------------------------------------------------------------
2 files changed, 11 insertions(+), 75 deletions(-)

diff --git a/prompt/handle.test.ts b/prompt/handle.test.ts @@ -142,13 +142,13 @@ describe("handle", () => { "template:default", "--yes", ], - { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }, + { stdio: "ignore" }, ); // start expect(spawnSync).toHaveBeenCalledWith( "limactl", ["start", sessionId, "--yes"], - { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }, + { stdio: "ignore" }, ); }); @@ -209,7 +209,7 @@ describe("handle", () => { expect(spawnSync).toHaveBeenCalledWith( "limactl", ["start", sessionId, "--yes"], - { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }, + { stdio: "ignore" }, ); }); @@ -230,7 +230,7 @@ describe("handle", () => { expect(spawnSync).toHaveBeenCalledWith( "limactl", ["start", sessionId, "--yes"], - { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }, + { stdio: "ignore" }, ); }); diff --git a/prompt/handle.ts b/prompt/handle.ts @@ -1,58 +1,8 @@ import type { OpenpodContext } from "../context"; import { spawnSync } from "node:child_process"; import * as fs from "node:fs"; -import * as os from "node:os"; import * as path from "node:path"; -/** - * Log a failed spawn with its captured stderr/stdout. The openpod log file is - * not collected on CI runners, so also write the message to stderr where the - * CI job output can see it. - */ -function logFailure( - logger: OpenpodContext["logger"], - label: string, - result: ReturnType<typeof spawnSync>, -): void { - if (result.status === 0) return; - - const stderr = typeof result.stderr === "string" ? result.stderr.trim() : ""; - const stdout = typeof result.stdout === "string" ? result.stdout.trim() : ""; - const message = [ - `${label} exited with ${result.status}`, - result.error ? `error: ${result.error.message}` : "", - stderr ? `stderr:\n${stderr}` : "", - stdout ? `stdout:\n${stdout}` : "", - ] - .filter(Boolean) - .join("\n"); - - logger.log(message, "error"); - console.error(`[openpod] ${message}`); -} - -/** - * When `limactl start` fails, its own stderr usually only contains the - * hostagent summary. The actual QEMU error is written to ha.stderr.log. - */ -function logLimaHostagentLog( - logger: OpenpodContext["logger"], - sessionId: string, -): void { - const instanceDir = path.join(os.homedir(), ".lima", sessionId); - const filePath = path.join(instanceDir, "ha.stderr.log"); - try { - if (!fs.existsSync(filePath)) return; - const contents = fs.readFileSync(filePath, "utf8").trim(); - if (!contents) return; - const message = `ha.stderr.log:\n${contents}`; - logger.log(message, "error"); - console.error(`[openpod] ${message}`); - } catch (err) { - logger.log(`failed to read ${filePath}: ${err}`, "error"); - } -} - export type HandleParams = { ctx: OpenpodContext; sessionId: string; @@ -121,27 +71,21 @@ export function handle(params: HandleParams): void { "--yes", ], { - encoding: "utf8", - stdio: ["ignore", "pipe", "pipe"], + stdio: "ignore", }, ); - logFailure(logger, `limactl create ${sessionId}`, createResult); + if (createResult.status !== 0) { + logger.log(`limactl create exited with ${createResult.status}`); + } } function startLimaInstance(sessionId: string): void { logger.log(`starting lima instance ${sessionId}`); const startResult = spawnSync("limactl", ["start", sessionId, "--yes"], { - encoding: "utf8", - stdio: ["ignore", "pipe", "pipe"], + stdio: "ignore", }); - logFailure(logger, `limactl start ${sessionId}`, startResult); if (startResult.status !== 0) { - logLimaHostagentLog(logger, sessionId); - if (process.platform === "linux") { - const kvmMessage = `/dev/kvm exists: ${fs.existsSync("/dev/kvm")}`; - logger.log(kvmMessage, "error"); - console.error(`[openpod] ${kvmMessage}`); - } + logger.log(`limactl start exited with ${startResult.status}`); } } @@ -149,15 +93,7 @@ export function handle(params: HandleParams): void { fs.mkdirSync(openpodRoot, { recursive: true }); const result = spawnSync("git", ["clone", originUrl, target]); if (result.status !== 0) { - const stderr = result.stderr?.toString().trim(); - const message = [ - `git clone failed with exit code ${result.status}`, - stderr ? `stderr:\n${stderr}` : "", - ] - .filter(Boolean) - .join("\n"); - logger.log(message, "error"); - console.error(`[openpod] ${message}`); + logger.log(`git clone failed with exit code ${result.status}`); try { fs.rmSync(target, { recursive: true, force: true }); } catch {