fix(coding-agent): drain follow-ups queued during agent_end
When an extension queues a follow-up during `agent_end` it gets stuck on the follow-up queue until after the next user message. Add a hasQueuedMessages() check to _handlePostAgentRun so the existing while/continue loop drains them. - One-line fix in _handlePostAgentRun - Integration test in agent-session-queue - git-merge-and-resolve example extension with tests
This commit is contained in:
@@ -947,7 +947,13 @@ export class AgentSession {
|
||||
this._retryAttempt = 0;
|
||||
}
|
||||
|
||||
return await this._checkCompaction(msg);
|
||||
if (await this._checkCompaction(msg)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// The agent loop drains both queues before emitting agent_end. Any messages
|
||||
// here were queued by agent_end extension handlers and need a continuation.
|
||||
return this.agent.hasQueuedMessages();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user