-
Notifications
You must be signed in to change notification settings - Fork 126
Add assistant reset state and generate diagnostics commands #10630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
diagnostics to user data dir
|
E2E Tests 🚀 |
sharon-wang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great -- some initial thoughts on the diagnostics file. I'll test out the state clearing functionality separately (or @timtmok might get to it before me 🙂 )
| // Report if an API key is configured | ||
| try { | ||
| const apiKey = await context.secrets.get(`apiKey-${model.id}`); | ||
| if (apiKey) { | ||
| fields.push(` - API Key: Yes`); | ||
| } | ||
| } catch (error) { | ||
| log.trace(`Failed to check API key for model ${model.id}: ${formatError(error)}`); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessarily for this PR -- should we note if the api key is specified via env var, like ANTHROPIC_API_KEY?
|
|
||
| const sections = Object.entries(byVendor).map(([vendor, vendorModels]) => { | ||
| const modelList = vendorModels | ||
| .map(m => ` - ${m.name} (${m.id}) - Max Input: ${m.maxInputTokens ?? 'unknown'}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add max output tokens here too?
| } | ||
|
|
||
| private addToBuffer(level: LogEntry['level'], message: string): void { | ||
| this.buffer.push({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome that we can get the log messages regardless of the user's log level! This is super helpful since the default log level doesn't give us much
|
|
||
| async function getChatExportInfo(): Promise<string> { | ||
| try { | ||
| const chatExport = await positron.ai.getChatExport(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably be done in a followup change to include all the chat locations. This gets the last focused and we might want to export all the current chat sessions.
My initial export after creating an inline chat included the panel chat instead since I accidentally focused the chat view.
modal after clearing state before reload
Addresses #10344 and #10346
Adds two new commands:
The Reset State command brings up a modal with some details of what is being reset and giving the option to generate a diagnostics report prior to clearing the state. If generated, the diagnostics report is saved to the user's data directory and and is open when the window reloads.
Resetting the state performs the following tasks:
positron.assistantworkbench.action.chat.clearHistoryworkbench.action.chat.clearInputHistoryProgress is provided via notifications about the state reset.
The diagnostics report is a markdown file generated in an editor window. It includes the following:
To retrieve the Positron Assistant logs I created a wrapper class around
LogOutputChannelthat uses a circular buffer to track the most recent log entries. We could modify the copilot extension to use this class as well if we think including those logs on the report is beneficial.Release Notes
New Features
Bug Fixes
QA Notes
The only assistant state remaining after a reset should be the configured user settings.
@:assistant