fix(coding-agent): add session_shutdown reasons closes #2863

This commit is contained in:
Mario Zechner
2026-04-20 23:10:49 +02:00
parent 1891b9ac01
commit 12d7161884
10 changed files with 75 additions and 30 deletions

View File

@@ -67,6 +67,7 @@ import {
type TurnStartEvent,
wrapRegisteredTools,
} from "./extensions/index.js";
import { emitSessionShutdownEvent } from "./extensions/runner.js";
import type { BashExecutionMessage, CustomMessage } from "./messages.js";
import type { ModelRegistry } from "./model-registry.js";
import { expandPromptTemplate, type PromptTemplate } from "./prompt-templates.js";
@@ -2372,7 +2373,7 @@ export class AgentSession {
async reload(): Promise<void> {
const previousFlagValues = this._extensionRunner.getFlagValues();
await this._extensionRunner.emit({ type: "session_shutdown" });
await emitSessionShutdownEvent(this._extensionRunner, { type: "session_shutdown", reason: "reload" });
await this.settingsManager.reload();
resetApiProviders();
await this._resourceLoader.reload();