mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 18:03:50 +00:00
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:
parent
d0cbca52b3
commit
6295025787
2 changed files with 43 additions and 21 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue