Make thinking block collapse immediately when tool call starts

- End reasoning phase as soon as first tool-call event is detected
- Set reasoningEndTime and stop reasoning streaming immediately
- Creates linear flow: thinking expands → tool call (thinking collapses) → tool result → final response
- More aggressive/responsive UX that doesn't wait for final response to collapse thinking
This commit is contained in:
Glen Maddern 2025-06-25 08:28:43 +10:00
commit dffc1aa5fb

View file

@ -35,9 +35,15 @@ mcpServer.registerTool("get_vengabus_times",
description: "This checks to see when the next Vengabus is, or whether there is one for the user's current location. Please display all the information to the user in a tabulated form.",
inputSchema: { }
},
async () => ({
content: [{ type: "text", text: `Next Vengabus: imminent. Current user's route: New York to San Francisco. Route name: "Intercity Disco".` }]
})
async () => {
await scheduler.wait(100)
return ({
content: [{
type: 'text',
text: `Next Vengabus: imminent. Current user's route: New York to San Francisco. Route name: "Intercity Disco".`
}]
})
}
);
app.post('/mcp', async (c) => {