Abort session work during dispose
This commit is contained in:
@@ -708,6 +708,16 @@ export class AgentSession {
|
||||
* Call this when completely done with the session.
|
||||
*/
|
||||
dispose(): void {
|
||||
try {
|
||||
this.abortRetry();
|
||||
this.abortCompaction();
|
||||
this.abortBranchSummary();
|
||||
this.abortBash();
|
||||
this.agent.abort();
|
||||
} catch {
|
||||
// Dispose must succeed even if an abort hook throws.
|
||||
}
|
||||
|
||||
this._extensionRunner.invalidate(
|
||||
"This extension ctx is stale after session replacement or reload. Do not use a captured pi or command ctx after ctx.newSession(), ctx.fork(), ctx.switchSession(), or ctx.reload(). For newSession, fork, and switchSession, move post-replacement work into withSession and use the ctx passed to withSession. For reload, do not use the old ctx after await ctx.reload().",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user