Skip to content

Conversation

gagik
Copy link
Contributor

@gagik gagik commented Sep 16, 2025

Adds confirmation step to assistant explain entry point

callback();

if (chat.status === 'streaming') {
await chat.stop();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this does mean entry points will interupt current stream. imo this is the best way to deal with it. If someone is using an entry point they probably do not care about the current chat anymore.

@gagik gagik marked this pull request as ready for review September 16, 2025 13:59
@Copilot Copilot AI review requested due to automatic review settings September 16, 2025 13:59
@gagik gagik requested a review from a team as a code owner September 16, 2025 13:59
@gagik gagik requested a review from nbbeeken September 16, 2025 13:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a confirmation step to the explain plan entrypoint and refactors message handling to support confirmation metadata in the Compass Assistant feature.

  • Introduces confirmation metadata structure to assistant messages with pending/confirmed/rejected states
  • Adds UI components for displaying and handling confirmation prompts
  • Updates the explain plan prompt to require user confirmation before sending data

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/compass-assistant/src/prompts.ts Refactors EntryPointMessage type and adds confirmation metadata to explain plan prompt
packages/compass-assistant/src/docs-provider-transport.ts Updates transport to filter out messages with confirmation metadata and use model injection
packages/compass-assistant/src/docs-provider-transport.spec.ts Adds comprehensive tests for message filtering and transport behavior
packages/compass-assistant/src/components/confirmation-message.tsx Creates new UI component for displaying confirmation prompts
packages/compass-assistant/src/components/confirmation-message.spec.tsx Tests for the confirmation message component
packages/compass-assistant/src/components/assistant-chat.tsx Updates chat component to render confirmation messages and handle user interactions
packages/compass-assistant/src/components/assistant-chat.spec.tsx Adds tests for confirmation message handling in the chat interface
packages/compass-assistant/src/compass-assistant-provider.tsx Updates provider to support confirmation metadata and model injection
packages/compass-assistant/src/compass-assistant-drawer.tsx Updates import path for assistant chat component

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gagik gagik force-pushed the gagik/confirmation branch from 899e732 to d5493be Compare September 16, 2025 14:50
@gagik gagik requested a review from lerouxb September 16, 2025 14:56
});
if (newState === 'confirmed') {
// Force the new message request to be sent
void ensureOptInAndSend?.(undefined, {}, () => {});
Copy link
Contributor

@lerouxb lerouxb Sep 17, 2025

Choose a reason for hiding this comment

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

This kinda threw me - the message parameter is optional? And I realise that the message isn't actually new - it just don't have this confirmed prop which means it will now be sent for the first time. Which is a bit nitpicky of me regarding the comment.

I think we should maybe make ensureOptInAndSend's callback parameter optional if we're not going to track anything in some cases like this. But shouldn't we be tracking something? We're missing out on Assistant Prompt Submitted in this path, right? Or am I mistaken?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we are though I'm unsure if we want to have this, it depends on if we consider an entry point a submitted prompt or if it's just user ones

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose we track the entrypoints used. But should we track the ones that make it past confirmation? I imagine that drop-off would be useful stats to have.

@gagik gagik merged commit 9c656bb into main Sep 17, 2025
57 of 59 checks passed
@gagik gagik deleted the gagik/confirmation branch September 17, 2025 14:25
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.

2 participants