aboutsummaryrefslogtreecommitdiff
path: root/src/integration/assets/opencode/herdr-agent-state.test.ts
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-22 16:25:17 +0300
committerGitHub <noreply@github.com>2026-09-22 16:25:17 +0300
commitf6390752a57a5ac3256f3213af870c0b62e224d7 (patch)
tree5b622345c5b274d82a9ff8a80a2be8adf7f67968 /src/integration/assets/opencode/herdr-agent-state.test.ts
parent46a5091838de66c1be193990afc3ad9145e6b4f5 (diff)
fix: track opencode subagent status per pane (#4357)
refs #1362
Diffstat (limited to 'src/integration/assets/opencode/herdr-agent-state.test.ts')
-rw-r--r--src/integration/assets/opencode/herdr-agent-state.test.ts27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/integration/assets/opencode/herdr-agent-state.test.ts b/src/integration/assets/opencode/herdr-agent-state.test.ts
index 38c1f05c..93d27583 100644
--- a/src/integration/assets/opencode/herdr-agent-state.test.ts
+++ b/src/integration/assets/opencode/herdr-agent-state.test.ts
@@ -1,4 +1,7 @@
-import { beforeEach, expect, mock, test } from "bun:test";
+import { afterEach, beforeEach, expect, mock, test } from "bun:test";
+
+const originalArgv = process.argv;
+afterEach(() => { process.argv = originalArgv; });
const requests: unknown[] = [];
const clients: FakeClient[] = [];
@@ -43,6 +46,7 @@ beforeEach(() => {
clients.length = 0;
requestWaiters.length = 0;
autoAcknowledge = true;
+ process.argv = ["bun", "/$bunfs/root/src/index.js", "run"];
process.env.HERDR_ENV = "1";
process.env.HERDR_SOCKET_PATH = "test.sock";
process.env.HERDR_PANE_ID = "test:p1";
@@ -223,6 +227,27 @@ test("routes nested child prompts to their own root, not the last active root",
]);
});
+test("only local run and Mini own server lifecycle, never shared servers or TUI workers", async () => {
+ for (const args of [
+ ["run"], ["run", "--session", "existing"], ["--mini"], ["--mini", "--session", "existing"],
+ ["--print-logs", "--log-level", "DEBUG", "run"], ["run", "--", "--attach"],
+ ]) {
+ process.argv = ["bun", "/$bunfs/root/src/index.js", ...args];
+ expect((await loadPlugin()).event).toBeFunction();
+ }
+ for (const args of [
+ [], ["--session", "existing"], ["serve"], ["web"], ["attach", "http://localhost:4096"],
+ ["run", "--attach", "http://localhost:4096"], ["--mini", "--attach=http://localhost:4096"],
+ ["serve", "--", "--mini"],
+ ]) {
+ process.argv = ["bun", "/$bunfs/root/src/index.js", ...args];
+ expect(await loadPlugin()).toEqual({});
+ }
+ process.argv = ["bun", "/$bunfs/root/src/cli/tui/worker.js"];
+ expect(await loadPlugin()).toEqual({});
+ expect(requests).toHaveLength(0);
+});
+
function requestMethod(request: unknown): unknown {
return isRecord(request) ? request.method : undefined;
}