feat(coding-agent): add ctx.reload and reload-runtime example closes #1371
This commit is contained in:
@@ -1068,6 +1068,9 @@ export class InteractiveMode {
|
||||
await this.handleResumeSession(sessionPath);
|
||||
return { cancelled: false };
|
||||
},
|
||||
reload: async () => {
|
||||
await this.handleReloadCommand();
|
||||
},
|
||||
},
|
||||
shutdownHandler: () => {
|
||||
this.shutdownRequested = true;
|
||||
|
||||
@@ -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}`);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user