// chat-agent.ts - Parent agent with sub-agent
export const chatAgent = new Agent({
id: 'chat-agent',
instructions: {
role: 'system',
content: 'You are a router...',
providerOptions: {
anthropic: {
thinking: { type: 'enabled', budgetTokens: 4000 }
}
}
},
model: 'anthropic/claude-haiku-4-5',
agents: { strategist: strategistAgent }
});
// Test script
const stream = await chatAgent.network('Hello', { memory: { thread: 'test' } });
for await (const chunk of stream) {
console.log(chunk.type);
// Never see: agent-execution-event-reasoning-delta
// Do see: agent-execution-event-text-delta
}
// chat-agent.ts - Parent agent with sub-agent
export const chatAgent = new Agent({
id: 'chat-agent',
instructions: {
role: 'system',
content: 'You are a router...',
providerOptions: {
anthropic: {
thinking: { type: 'enabled', budgetTokens: 4000 }
}
}
},
model: 'anthropic/claude-haiku-4-5',
agents: { strategist: strategistAgent }
});
// Test script
const stream = await chatAgent.network('Hello', { memory: { thread: 'test' } });
for await (const chunk of stream) {
console.log(chunk.type);
// Never see: agent-execution-event-reasoning-delta
// Do see: agent-execution-event-text-delta
}