2003
2004
private async _abortSession(chat: URI): Promise<void> {
2005
>
// Phase 9 D1: cancel via the abort controller, NOT `Query.interrupt()`.
claudeAgent.ts
2006
>
// Abort is a control-plane operation — it must NOT serialize
2007
>
// through `_sessionSequencer` because an in-flight `sendMessage`
2008
>
// task is parked on its turn deferred and would deadlock the abort
2009
>
// behind the very turn it's trying to cancel. Calling
2010
>
// `chat.abort()` directly rejects the in-flight deferred,
2011
>
// which lets the queued sendMessage task complete and frees the
2012
>
// sequencer for the next caller.
2013
>
const sess = this._getChatContext(chat).target;
2014
>
if (!sess) {
2015
return;
2016
}