fix(coding-agent): handle stale extension contexts

fixes #3606
This commit is contained in:
Mario Zechner
2026-04-23 22:06:55 +02:00
parent 0cb8ff3843
commit f0cf8a59d2
9 changed files with 77 additions and 17 deletions

View File

@@ -362,6 +362,9 @@ export class InteractiveMode {
private options: InteractiveModeOptions = {},
) {
this.runtimeHost = runtimeHost;
this.runtimeHost.setBeforeSessionInvalidate(() => {
this.resetExtensionUI();
});
this.runtimeHost.setRebindSession(async () => {
await this.rebindCurrentSession();
});
@@ -1594,7 +1597,6 @@ export class InteractiveMode {
}
private async rebindCurrentSession(): Promise<void> {
this.resetExtensionUI();
this.unsubscribe?.();
this.unsubscribe = undefined;
this.applyRuntimeSettings();
@@ -3219,7 +3221,6 @@ export class InteractiveMode {
if (this.isShuttingDown) return;
this.isShuttingDown = true;
this.unregisterSignalHandlers();
this.resetExtensionUI();
await this.runtimeHost.dispose();
// Wait for any pending renders to complete