test: stabilize breaking-change expectations for doctor, tools, and model reset
This commit is contained in:
@@ -225,9 +225,15 @@ models:
|
|||||||
|
|
||||||
it('reports WARN for Google Calendar when token missing in file and auth store', async () => {
|
it('reports WARN for Google Calendar when token missing in file and auth store', async () => {
|
||||||
mkdirSync(testDir, { recursive: true });
|
mkdirSync(testDir, { recursive: true });
|
||||||
|
process.env.HOME = testDir;
|
||||||
const configPath = join(testDir, 'config.yaml');
|
const configPath = join(testDir, 'config.yaml');
|
||||||
const credsPath = join(testDir, 'gcal-creds.json');
|
const credsPath = join(testDir, 'gcal-creds.json');
|
||||||
writeFileSync(credsPath, '{}');
|
writeFileSync(credsPath, '{}');
|
||||||
|
mkdirSync(join(testDir, '.config/flynn'), { recursive: true });
|
||||||
|
writeFileSync(
|
||||||
|
join(testDir, '.config/flynn/auth.json'),
|
||||||
|
JSON.stringify({}),
|
||||||
|
);
|
||||||
writeFileSync(configPath, `
|
writeFileSync(configPath, `
|
||||||
telegram:
|
telegram:
|
||||||
bot_token: "test-token"
|
bot_token: "test-token"
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ describe('createAgentHandlers command fast-path', () => {
|
|||||||
modelRouter: modelRouter as unknown as AgentHandlerDeps['modelRouter'],
|
modelRouter: modelRouter as unknown as AgentHandlerDeps['modelRouter'],
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
models: {
|
models: {
|
||||||
default: { provider: 'anthropic', model: 'claude-sonnet-4' },
|
default: { provider: 'anthropic', model: 'claude-sonnet-4', api_key: 'test-anthropic-key' },
|
||||||
fallback_chain: [],
|
fallback_chain: [],
|
||||||
},
|
},
|
||||||
} as unknown as AgentHandlerDeps['runtimeConfig'],
|
} as unknown as AgentHandlerDeps['runtimeConfig'],
|
||||||
@@ -198,7 +198,7 @@ describe('createAgentHandlers command fast-path', () => {
|
|||||||
modelRouter: modelRouter as unknown as AgentHandlerDeps['modelRouter'],
|
modelRouter: modelRouter as unknown as AgentHandlerDeps['modelRouter'],
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
models: {
|
models: {
|
||||||
default: { provider: 'anthropic', model: 'claude-sonnet-4' },
|
default: { provider: 'anthropic', model: 'claude-sonnet-4', api_key: 'test-anthropic-key' },
|
||||||
fallback_chain: [],
|
fallback_chain: [],
|
||||||
},
|
},
|
||||||
} as unknown as AgentHandlerDeps['runtimeConfig'],
|
} as unknown as AgentHandlerDeps['runtimeConfig'],
|
||||||
|
|||||||
@@ -120,10 +120,13 @@ describe('Tool integration (end-to-end)', () => {
|
|||||||
}
|
}
|
||||||
// Second call: verify the tool result was included in messages
|
// Second call: verify the tool result was included in messages
|
||||||
const lastMsg = request.messages[request.messages.length - 1] as { content: unknown[] };
|
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.type).toBe('tool_result');
|
||||||
expect(resultBlock.tool_use_id).toBe('c1');
|
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 {
|
return {
|
||||||
content: 'Verified tool result',
|
content: 'Verified tool result',
|
||||||
|
|||||||
Reference in New Issue
Block a user