Insert navigation messages when agent finishes working (after tool execution)
- Track agent busy state: isStreaming OR pendingToolCalls.size > 0 - When agent transitions from busy to idle, check for URL changes - Extract checkAndInsertNavMessage() helper function - Call helper from both onBeforeSend (user submit) and agent state subscription (post-tool) - Fixes issue where browser_javascript tool navigates page but no nav message inserted - Navigation messages now appear after tools that change window.location.href
This commit is contained in:
@@ -293,10 +293,10 @@ export class Agent {
|
||||
this.patch({ isStreaming: false, streamMessage: null, pendingToolCalls: new Set<string>() });
|
||||
this.abortController = undefined;
|
||||
}
|
||||
{
|
||||
/*{
|
||||
const { systemPrompt, model, messages } = this._state;
|
||||
console.log("final state:", { systemPrompt, model, messages });
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
private patch(p: Partial<AgentState>): void {
|
||||
|
||||
Reference in New Issue
Block a user