mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 07:03:25 +00:00
fix(coding-agent): queue messages during branch summarization (#1803)
Messages submitted while a branch summary was being generated were processed immediately instead of being queued. This happened because isCompacting only checked compaction abort controllers, not the branch summary abort controller. Include _branchSummaryAbortController in the isCompacting getter so all existing guards (message queueing, reload blocking) also apply during branch summarization.
This commit is contained in:
parent
d515cbd0b8
commit
5c61d6bc92
2 changed files with 10 additions and 2 deletions
|
|
@ -677,9 +677,13 @@ export class AgentSession {
|
||||||
this.agent.setSystemPrompt(this._baseSystemPrompt);
|
this.agent.setSystemPrompt(this._baseSystemPrompt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Whether auto-compaction is currently running */
|
/** Whether compaction or branch summarization is currently running */
|
||||||
get isCompacting(): boolean {
|
get isCompacting(): boolean {
|
||||||
return this._autoCompactionAbortController !== undefined || this._compactionAbortController !== undefined;
|
return (
|
||||||
|
this._autoCompactionAbortController !== undefined ||
|
||||||
|
this._compactionAbortController !== undefined ||
|
||||||
|
this._branchSummaryAbortController !== undefined
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** All messages including custom types like BashExecutionMessage */
|
/** All messages including custom types like BashExecutionMessage */
|
||||||
|
|
|
||||||
|
|
@ -193,6 +193,10 @@ describe.skipIf(!API_KEY)("AgentSession tree navigation e2e", () => {
|
||||||
|
|
||||||
// Abort after a short delay (let the LLM call start)
|
// Abort after a short delay (let the LLM call start)
|
||||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||||
|
|
||||||
|
// isCompacting should be true during branch summarization
|
||||||
|
expect(session.isCompacting).toBe(true);
|
||||||
|
|
||||||
session.abortBranchSummary();
|
session.abortBranchSummary();
|
||||||
|
|
||||||
const result = await navigationPromise;
|
const result = await navigationPromise;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue