test: stabilize breaking-change expectations for doctor, tools, and model reset

This commit is contained in:
William Valentin
2026-02-23 20:46:58 -08:00
parent b1b59ef25d
commit c4f5dfb52f
3 changed files with 13 additions and 4 deletions
+6
View File
@@ -225,9 +225,15 @@ models:
it('reports WARN for Google Calendar when token missing in file and auth store', async () => {
mkdirSync(testDir, { recursive: true });
process.env.HOME = testDir;
const configPath = join(testDir, 'config.yaml');
const credsPath = join(testDir, 'gcal-creds.json');
writeFileSync(credsPath, '{}');
mkdirSync(join(testDir, '.config/flynn'), { recursive: true });
writeFileSync(
join(testDir, '.config/flynn/auth.json'),
JSON.stringify({}),
);
writeFileSync(configPath, `
telegram:
bot_token: "test-token"
+2 -2
View File
@@ -160,7 +160,7 @@ describe('createAgentHandlers command fast-path', () => {
modelRouter: modelRouter as unknown as AgentHandlerDeps['modelRouter'],
runtimeConfig: {
models: {
default: { provider: 'anthropic', model: 'claude-sonnet-4' },
default: { provider: 'anthropic', model: 'claude-sonnet-4', api_key: 'test-anthropic-key' },
fallback_chain: [],
},
} as unknown as AgentHandlerDeps['runtimeConfig'],
@@ -198,7 +198,7 @@ describe('createAgentHandlers command fast-path', () => {
modelRouter: modelRouter as unknown as AgentHandlerDeps['modelRouter'],
runtimeConfig: {
models: {
default: { provider: 'anthropic', model: 'claude-sonnet-4' },
default: { provider: 'anthropic', model: 'claude-sonnet-4', api_key: 'test-anthropic-key' },
fallback_chain: [],
},
} as unknown as AgentHandlerDeps['runtimeConfig'],
+5 -2
View File
@@ -120,10 +120,13 @@ describe('Tool integration (end-to-end)', () => {
}
// Second call: verify the tool result was included in messages
const lastMsg = request.messages[request.messages.length - 1] as { content: unknown[] };
const resultBlock = lastMsg.content[0] as { type: string; tool_use_id: string; content: string };
const resultBlock = lastMsg.content[0] as { type: string; tool_use_id: string; content: string; is_error: boolean };
expect(resultBlock.type).toBe('tool_result');
expect(resultBlock.tool_use_id).toBe('c1');
expect(resultBlock.content).toContain('verify_pass');
expect(resultBlock.is_error).toBe(true);
expect(resultBlock.content).toContain('[provenance=tool_output');
expect(resultBlock.content).toContain('tool=shell.exec');
expect(resultBlock.content).toContain("Tool 'shell.exec' denied:");
return {
content: 'Verified tool result',