Skip to content

Conversation

@zanesq
Copy link
Collaborator

@zanesq zanesq commented Nov 13, 2025

Summary

Add back tool notifications support for manual approval mid chat.
Verified locally

follow up for #5706

@zanesq zanesq requested a review from DOsinga November 13, 2025 19:26
@zanesq
Copy link
Collaborator Author

zanesq commented Nov 13, 2025

Closing while I look into a backend solution that doesn't modify messages on the front end

@zanesq zanesq closed this Nov 13, 2025
@zanesq zanesq reopened this Nov 14, 2025
});

let confirmation = Message::user().with_tool_confirmation_request(
let confirmation = Message::assistant().with_tool_confirmation_request(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we/shouldn't we just set this to agent invisible?

@zanesq zanesq requested a review from katzdave November 14, 2025 16:49
@zanesq zanesq mentioned this pull request Nov 14, 2025
10 tasks
});

let confirmation = Message::user().with_tool_confirmation_request(
let confirmation = Message::assistant().with_tool_confirmation_request(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' }>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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[];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the only consumer of this converts this to a map sorted by request_id - I would suggest to do that on construction

@zanesq zanesq merged commit 7dad810 into zane/nextcamp-live Nov 21, 2025
3 checks passed
@zanesq zanesq deleted the zane/nextcamp-live-notifications branch November 21, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants