feat(coding-agent): add ctx.reload and reload-runtime example closes #1371

This commit is contained in:
Mario Zechner 2026-02-08 15:08:16 +01:00
parent 0bd205ab87
commit e1b56c1d28
8 changed files with 114 additions and 0 deletions

View file

@ -1068,6 +1068,9 @@ export class InteractiveMode {
await this.handleResumeSession(sessionPath);
return { cancelled: false };
},
reload: async () => {
await this.handleReloadCommand();
},
},
shutdownHandler: () => {
this.shutdownRequested = true;

View file

@ -63,6 +63,9 @@ export async function runPrintMode(session: AgentSession, options: PrintModeOpti
const success = await session.switchSession(sessionPath);
return { cancelled: !success };
},
reload: async () => {
await session.reload();
},
},
onError: (err) => {
console.error(`Extension error (${err.extensionPath}): ${err.error}`);

View file

@ -295,6 +295,9 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
const success = await session.switchSession(sessionPath);
return { cancelled: !success };
},
reload: async () => {
await session.reload();
},
},
shutdownHandler: () => {
shutdownRequested = true;