fix(vscode): sync agent manager settings saves (#1245)
* fix(vscode): sync agent manager settings saves * fix(vscode): receive agent manager settings sync --------- Co-authored-by: Isaac Sanchez <isanchez-hawkins@arize.com>
This commit is contained in:
committed by
GitHub
co-authored by
Isaac Sanchez
parent
6b52efbd34
commit
cde9c656e7
@@ -97,6 +97,10 @@ export class AgentManagerPanelProvider {
|
||||
context: this._context,
|
||||
});
|
||||
this._panel?.webview.postMessage(response);
|
||||
|
||||
if (message.type === 'api:config/settings:save' && response.success) {
|
||||
void vscode.commands.executeCommand('openchamber.internal.settingsSynced', response.data);
|
||||
}
|
||||
}, null, this._context.subscriptions);
|
||||
}
|
||||
|
||||
@@ -121,6 +125,18 @@ export class AgentManagerPanelProvider {
|
||||
this._sendCachedState();
|
||||
}
|
||||
|
||||
public notifySettingsSynced(settings: unknown): void {
|
||||
if (!this._panel) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._panel.webview.postMessage({
|
||||
type: 'command',
|
||||
command: 'settingsSynced',
|
||||
payload: settings,
|
||||
});
|
||||
}
|
||||
|
||||
private _sendCachedState() {
|
||||
if (!this._panel) {
|
||||
return;
|
||||
|
||||
@@ -193,6 +193,7 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
vscode.commands.registerCommand('openchamber.internal.settingsSynced', (settings: unknown) => {
|
||||
chatViewProvider?.notifySettingsSynced(settings);
|
||||
sessionEditorProvider?.notifySettingsSynced(settings);
|
||||
agentManagerProvider?.notifySettingsSynced(settings);
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user