Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions packages/agent-bundle/tests/mcp-probe-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@ it('removes the fresh plugin data directory after every probe', async () => {
});

await service.probe({ host: 'claude', serverName: 'timeline' });
await service.settle();

await expect(readFile(join(pluginData!, 'proof.txt'), 'utf8')).rejects.toMatchObject({ code: 'ENOENT' });
} finally {
Expand Down
4 changes: 3 additions & 1 deletion packages/agent-bundle/tests/native-claude-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,14 @@ it('enforces a process timeout and output cap even when the child ignores termin
const harness = await loadNativeClaudeContract();
expect(harness).toBeDefined();

// The timeout must outlast child Node startup, or SIGTERM lands before the
// child installs its handler and the default action kills it.
const timedOut = await harness!.runNativeClaudeProcess({
args: ['-e', 'process.on("SIGTERM", () => undefined); setInterval(() => undefined, 1000);'],
cwd: process.cwd(),
environment: process.env,
executable: process.execPath,
}, { gracePeriodMs: 100, maxOutputBytes: 64, timeoutMs: 300 });
}, { gracePeriodMs: 100, maxOutputBytes: 64, timeoutMs: 2_000 });
expect(timedOut).toMatchObject({ exitCode: null, signal: 'SIGKILL', termination: 'timed-out' });

const oversized = await harness!.runNativeClaudeProcess({
Expand Down
12 changes: 10 additions & 2 deletions packages/agent-bundle/tests/support/eval-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ export interface SeedEvalProjectOptions {
readonly targets?: readonly string[];
}

const evalEntryPoint = resolve(process.cwd(), 'packages/agent-bundle/src/eval/index.ts');
// The defining modules, not src/eval/index.ts: suite discovery loads through
// Jiti with the module cache off, and the barrel's graph took ~30s per
// discovery on a loaded host, past eval admission deadlines.
const evalSuiteModule = resolve(process.cwd(), 'packages/agent-bundle/src/eval/suite.ts');
const evalAssertionsModule = resolve(process.cwd(), 'packages/agent-bundle/src/eval/assertions.ts');
// defineConfig's defining module, not the package entry: seeded configs load
// through Jiti with the module cache off, so re-exporting src/index.ts made
// every config load re-transpile the whole package graph (~5s per project).
Expand Down Expand Up @@ -101,7 +105,11 @@ export const seedEvalProject = async (
type: 'module',
}),
),
writeFile(join(root, 'node_modules/agent-bundle/eval.ts'), `export * from ${JSON.stringify(evalEntryPoint)};\n`),
writeFile(join(root, 'node_modules/agent-bundle/eval.ts'), [
`export { defineEvalSuite } from ${JSON.stringify(evalSuiteModule)};`,
`export { expectOutcome, expectSkillActivation } from ${JSON.stringify(evalAssertionsModule)};`,
'',
].join('\n')),
writeFile(
join(root, 'node_modules/agent-bundle/index.ts'),
`export { defineConfig } from ${JSON.stringify(sourceEntryPoint)};\n`,
Expand Down
Loading