Skip to content

Conversation

@lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Dec 18, 2025

This is copied liberally from Gagik's PoC with minimal changes so far.

To try it out you'll have to toggle the "enable tool calling" feature flag.

Screenshot 2025-12-18 at 17 25 43 Screenshot 2025-12-18 at 17 25 47 Screenshot 2025-12-18 at 17 25 57 Screenshot 2025-12-18 at 17 26 01


const toolName = getToolDisplayName(toolCall.type);
const description =
toolsController.getToolDescription(toolCall.type.replace(/^tool-/, '')) ||
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're probably not gonna need this


// Extract output text if available
const outputText = toolCall.output
? JSON.stringify(toolCall.output, null, 2)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if we want the context we send to be JSON (so we'd probably format it as EJSON?) or a string. Right now it is formatted as a string with our toJSString() helper which seems to work, but that's not exactly standard. And the output shows a bunch of line breaks if you expand it.

Still thinking about it..

Copy link
Contributor

Choose a reason for hiding this comment

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

eventually we'll adopt https://platform.openai.com/docs/guides/structured-outputs on the MCP server so JSON is likely going to be the end goal in some form

chat.messages = [...chat.messages, contextPrompt];
}

const { enableToolCalling } = preferences.getPreferences();
Copy link
Contributor Author

@lerouxb lerouxb Dec 18, 2025

Choose a reason for hiding this comment

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

This is something I'm probably gonna have to check with Sergey when he's back, but the preferences hook isn't working well here - it caches the initial value so it doesn't respond if you toggle the flag from the preferences modal.

This way at least works for now.

- Encourage the user to understand what they are doing before they act, e.g. by reading the official documentation or other related resources.
- Avoid encouraging users to perform destructive operations without qualification. Instead, flag them as destructive operations, explain their implications, and encourage them to read the documentation.
4. Always call the 'search_content' tool.
5. Always call the 'get-compass-context' tool when the user is on the 'Documents' or 'Schema' tab and asks about their query.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These prompt changes should be feature flagged. Probably easiest to just pick one prompt or another for now rather than doing logic inside here.

@github-actions github-actions bot added the feat label Dec 18, 2025
@lerouxb lerouxb added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Dec 18, 2025
isMyQueriesEnabled;

const query = useQueryBarQuery();
useSyncAssistantGlobalState('currentQuery', query);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea where the best place would be to sync the query. This was the most minimally invasive way I could quickly think of that's guaranteed to be "in sync".

: 'No output available';
const hasOutput = toolCall.state === 'output-available';

const isAwaitingApproval = toolCall.state === 'approval-requested';
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe a component which returns a different thing based on a switch statement instead? not too sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat feature flagged PRs labeled with this label will not be included in the release notes of the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants