diff --git a/src/main/java/com/sourcegraph/cody/agent/WebviewPostMessageParams.kt b/src/main/java/com/sourcegraph/cody/agent/WebviewPostMessageParams.kt index a47dd6b84d..bd7e589de9 100644 --- a/src/main/java/com/sourcegraph/cody/agent/WebviewPostMessageParams.kt +++ b/src/main/java/com/sourcegraph/cody/agent/WebviewPostMessageParams.kt @@ -41,8 +41,8 @@ data class ExtensionMessage( } fun toPanelNotFoundError(): PanelNotFoundError? { - // e.g.: "No panel with id 414f6f9c-ed62-4d7b-8ebd-023ded81e9da found" - if (this.errors?.matches(Regex("^No panel with id .* found$")) == true) { + // e.g.: "No panel with ID414f6f9c-ed62-4d7b-8ebd-023ded81e9da" + if (this.errors?.matches(Regex("^No panel with .*$")) == true) { return PanelNotFoundError(this.errors) } return null diff --git a/src/main/kotlin/com/sourcegraph/cody/config/notification/AccountSettingChangeListener.kt b/src/main/kotlin/com/sourcegraph/cody/config/notification/AccountSettingChangeListener.kt index 425cd08935..4a770d74d9 100644 --- a/src/main/kotlin/com/sourcegraph/cody/config/notification/AccountSettingChangeListener.kt +++ b/src/main/kotlin/com/sourcegraph/cody/config/notification/AccountSettingChangeListener.kt @@ -25,10 +25,11 @@ class AccountSettingChangeListener(project: Project) : ChangeListener(project) { javaToJSBridge?.callJS("pluginSettingsChanged", ConfigUtil.getConfigAsJson(project)) // Notify Cody Agent about config changes. - CodyAgentService.applyAgentOnBackgroundThread(project) { agent -> - if (ConfigUtil.isCodyEnabled()) { + if (ConfigUtil.isCodyEnabled()) { + CodyAgentService.applyAgentOnBackgroundThread(project) { agent -> agent.server.configurationDidChange(ConfigUtil.getAgentConfiguration(project)) } + CodyAgentService.getInstance(project).restartAgent(project) } val codyToolWindowContent = CodyToolWindowContent.getInstance(project)