Next camp tool notifications#5726
Conversation
|
Closing while I look into a backend solution that doesn't modify messages on the front end |
…essages array on the front end
| }); | ||
|
|
||
| let confirmation = Message::user().with_tool_confirmation_request( | ||
| let confirmation = Message::assistant().with_tool_confirmation_request( |
There was a problem hiding this comment.
I looked up what llms expect for this role and there is no clear standard. Goose says using Message::assistant() for tool confirmations is fine and arguably more semantically correct. The assistant is asking for permission, so it makes sense for it to come from the assistant role. Since these messages are filtered out before sending to the LLM, the role only matters for frontend rendering.
There was a problem hiding this comment.
can't we/shouldn't we just set this to agent invisible?
| }); | ||
|
|
||
| let confirmation = Message::user().with_tool_confirmation_request( | ||
| let confirmation = Message::assistant().with_tool_confirmation_request( |
There was a problem hiding this comment.
can't we/shouldn't we just set this to agent invisible?
|
|
||
| const resultsCache = new Map<string, { messages: Message[]; session: Session }>(); | ||
|
|
||
| export type NotificationEvent = Extract<MessageEvent, { type: 'Notification' }>; |
There was a problem hiding this comment.
I would flip the dependency around here and move this to message.ts since it is a related type
| throwOnError: true, | ||
| }); | ||
| } catch (error) { | ||
| console.error('Failed to send tool cancellation to backend:', error); |
There was a problem hiding this comment.
this will probably not fail, but we should be louder about it than logging since the agent I think will hang now
| stopStreaming: () => void; | ||
| sessionLoadError?: string; | ||
| tokenState: TokenState; | ||
| notifications: NotificationEvent[]; |
There was a problem hiding this comment.
I think the only consumer of this converts this to a map sorted by request_id - I would suggest to do that on construction
Summary
Add back tool notifications support for manual approval mid chat.
Verified locally
follow up for #5706