fix(coding-agent): avoid pre-prompt compaction continue
This commit is contained in:
@@ -1075,17 +1075,11 @@ export class AgentSession {
|
||||
throw new Error(formatNoApiKeyFoundMessage(this.model.provider));
|
||||
}
|
||||
|
||||
// Check if we need to compact before sending (catches aborted responses)
|
||||
// Check if we need to compact before sending (catches aborted responses).
|
||||
// The user's new prompt is sent below, so do not call agent.continue() here.
|
||||
const lastAssistant = this._findLastAssistantMessage();
|
||||
if (lastAssistant && (await this._checkCompaction(lastAssistant, false))) {
|
||||
try {
|
||||
await this.agent.continue();
|
||||
while (await this._handlePostAgentRun()) {
|
||||
await this.agent.continue();
|
||||
}
|
||||
} finally {
|
||||
this._flushPendingBashMessages();
|
||||
}
|
||||
if (lastAssistant) {
|
||||
await this._checkCompaction(lastAssistant, false);
|
||||
}
|
||||
|
||||
// Build messages array (custom message if any, then user message)
|
||||
|
||||
Reference in New Issue
Block a user