Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ce722ba
test: add runtime inbound command routing integration tests
teng-lin Feb 25, 2026
20bb394
test: add runtime capabilities/init flow integration tests
teng-lin Feb 25, 2026
61897ab
test: add runtime orchestration integration tests (git, control_respo…
teng-lin Feb 25, 2026
e5064ae
test: add coordinator→runtime integration tests for policy dispatch a…
teng-lin Feb 25, 2026
c2ec4a9
test: add coverage tests for reconnect-policy uncovered branches
teng-lin Feb 25, 2026
8220c7e
test: add coverage tests for waitForProcessGroupDead uncovered branches
teng-lin Feb 25, 2026
01fcc8a
test: add coverage tests for ConsumerGatekeeper uncovered branches
teng-lin Feb 25, 2026
b49fb0c
test: add coverage tests for idle-policy uncovered branches
teng-lin Feb 25, 2026
ee75007
fix: correct timer-cleared assertion in capabilities test
teng-lin Feb 25, 2026
c157fdc
fix: address CRITICAL+HIGH review findings in coordinator integration…
teng-lin Feb 25, 2026
199e65c
fix: strengthen process.kill signal assertions in process-manager cov…
teng-lin Feb 25, 2026
83dc8c8
fix: strengthen promise flush and fix test title in reconnect-policy …
teng-lin Feb 25, 2026
19fb619
docs: add integration test coverage plan and session-runtime test hel…
teng-lin Feb 25, 2026
35f7d23
fix: add explicit return type annotations to fix TS2742 in test helpers
teng-lin Feb 25, 2026
9ba97cd
test: add coverage for slash-command-chain uncovered branches
teng-lin Feb 25, 2026
cb6f5e6
test: add coverage for codex-message-translator uncovered branches
teng-lin Feb 25, 2026
deee993
test: add coverage for daemon-supervisor uncovered branches
teng-lin Feb 25, 2026
cd68161
test: extend reconnect-policy coverage for remaining branches
teng-lin Feb 25, 2026
246a49e
test: add coverage for message-tracer uncovered branches
teng-lin Feb 25, 2026
d6effb8
fix: apply PR review suggestions — vi.runAllTicks and vi.waitUntil fo…
teng-lin Feb 25, 2026
843cf04
test: add coverage for codex-session uncovered branches
teng-lin Feb 25, 2026
04d7518
test: add coverage for buffered-relay-manager uncovered branches
teng-lin Feb 25, 2026
94284ec
test: add coverage for opencode-adapter uncovered branches
teng-lin Feb 25, 2026
b1b1ba7
test: add coverage for session-registry-service uncovered branches
teng-lin Feb 25, 2026
d98d084
chore: remove integration test coverage plan doc
teng-lin Feb 25, 2026
59639fc
test: add coverage for prometheus-metrics-collector uncovered branches
teng-lin Feb 25, 2026
0f66c2a
test: add coverage for pairing uncovered branches
teng-lin Feb 25, 2026
835a098
test: add coverage for codex-adapter uncovered branches
teng-lin Feb 25, 2026
473dde6
test: add coverage for lock-file and state-file uncovered branches
teng-lin Feb 25, 2026
0bfccb9
test: add coverage for agent-sdk-session uncovered branches
teng-lin Feb 25, 2026
09cd617
test: add coverage for acp-adapter and state-migrator uncovered branches
teng-lin Feb 25, 2026
cb45503
test: add coverage for opencode-message-translator uncovered branches
teng-lin Feb 25, 2026
9f5a41b
test: add coverage for file-storage uncovered branches
teng-lin Feb 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions src/adapters/acp/acp-adapter-coverage.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* Coverage tests targeting lines 62-63 of acp-adapter.ts:
* the branch where spawn returns a child process with missing stdin/stdout pipes.
*
* Branch: `if (!child.stdin || !child.stdout) { child.kill(); throw ... }`
*/

import type { ChildProcess } from "node:child_process";
import { EventEmitter } from "node:events";
import { describe, expect, it, vi } from "vitest";
import type { SpawnFn } from "./acp-adapter.js";
import { AcpAdapter } from "./acp-adapter.js";

function makeMinimalChild(overrides: Partial<{ stdin: unknown; stdout: unknown }>): ChildProcess {
const child = new EventEmitter() as ChildProcess;
const kill = vi.fn((_signal?: string) => true);
Object.assign(child, {
stdin: overrides.stdin ?? null,
stdout: overrides.stdout ?? null,
stderr: new EventEmitter(),
pid: 99999,
killed: false,
kill,
});
return child;
}

describe("AcpAdapter — missing stdio pipes (lines 62-63)", () => {
it("kills child and throws when stdin is null", async () => {
// Spawn returns a child whose stdin is null (e.g. stdio: 'ignore')
const child = makeMinimalChild({ stdin: null, stdout: new EventEmitter() });
const spawnFn: SpawnFn = vi.fn(() => child);

const adapter = new AcpAdapter(spawnFn);
await expect(adapter.connect({ sessionId: "sess-no-stdin" })).rejects.toThrow(
"Failed to open stdio pipes for ACP subprocess",
);

expect(child.kill).toHaveBeenCalled();
});

it("kills child and throws when stdout is null", async () => {
// Spawn returns a child whose stdout is null
const child = makeMinimalChild({ stdin: new EventEmitter(), stdout: null });
const spawnFn: SpawnFn = vi.fn(() => child);

const adapter = new AcpAdapter(spawnFn);
await expect(adapter.connect({ sessionId: "sess-no-stdout" })).rejects.toThrow(
"Failed to open stdio pipes for ACP subprocess",
);

expect(child.kill).toHaveBeenCalled();
});

it("kills child and throws when both stdin and stdout are null", async () => {
const child = makeMinimalChild({ stdin: null, stdout: null });
const spawnFn: SpawnFn = vi.fn(() => child);

const adapter = new AcpAdapter(spawnFn);
await expect(adapter.connect({ sessionId: "sess-no-pipes" })).rejects.toThrow(
"Failed to open stdio pipes for ACP subprocess",
);

expect(child.kill).toHaveBeenCalled();
});
});
Loading