Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/coding-agent/src/core/agent-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4232,6 +4232,8 @@ export class AgentSession {
if (reason === "overflow") this._overflowRecoveryAttempted = false;
return false;
}
if (!this._ownsCompactionController(autoCompactionController, "auto")) return false;
this._emit({ type: "compaction_start", reason });

const authResult = await this._modelRuntime.getAuth(this.model);
if (!this._ownsCompactionController(autoCompactionController, "auto")) return false;
Expand All @@ -4250,7 +4252,6 @@ export class AgentSession {
return false;
}
if (!this._ownsCompactionController(autoCompactionController, "auto")) return false;
this._emit({ type: "compaction_start", reason });

const execution = await this._executeCompaction({
controller: autoCompactionController,
Expand Down
2 changes: 2 additions & 0 deletions packages/coding-agent/src/core/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
controller at operation start, rejects stale completion/feedback, and retains the terminal result until another
operation begins. Feedback-only aborts publish one terminal event, and accepted completions publish their terminal
event before `session_compact` handlers can begin a fresh operation.
- Owned automatic compaction attempts publish `compaction_start` before authentication/preparation so an early
preparation failure does not invisibly consume the one overflow retry attempt.
- Durable append now rejects a generation whose message revision or agent-message snapshot changed during preparation
or summary generation (`stale-revision`), preserving intervening context without duplicate replay.
- Required compaction uses one provider-admission gate for normal prompts, extension-triggered turns, and every next
Expand Down
Loading