Skip to content

Commit 708fb3e

Browse files
committed
tests: Preserve RecordingClient after restart
1 parent a971527 commit 708fb3e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/__tests__/CodexACPAgent/e2e/spawned-agent-fixture.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export async function createSpawnedAgentFixture(
4444
initializeConnection: ConnectionInitializer,
4545
extraEnv?: NodeJS.ProcessEnv,
4646
paths = RuntimePaths.createTemporary(),
47+
client: RecordingClient = new RecordingClient(),
4748
): Promise<SpawnedAgentFixture> {
4849
const agentProcess = spawn("npm", ["run", "--silent", "start"], {
4950
cwd: process.cwd(),
@@ -57,7 +58,7 @@ export async function createSpawnedAgentFixture(
5758
});
5859

5960
const fixture = new SpawnedAgentFixtureImpl(
60-
new RecordingClient(),
61+
client,
6162
agentProcess,
6263
paths,
6364
initializeConnection,
@@ -167,7 +168,7 @@ class SpawnedAgentFixtureImpl implements SpawnedAgentFixture {
167168

168169
async restart(): Promise<SpawnedAgentFixture> {
169170
await this.stopProcess(false);
170-
return await createSpawnedAgentFixture(this.initializeConnection, this.extraEnv, this.paths);
171+
return await createSpawnedAgentFixture(this.initializeConnection, this.extraEnv, this.paths, this.client);
171172
}
172173

173174
writeSkill(skill: TestSkill, rootDir?: string): void {

0 commit comments

Comments
 (0)