Merge remote-tracking branch 'upstream/main' into feat/error-notify

This commit is contained in:
Mathews-Tom
2026-07-08 20:27:10 +05:30
141 changed files with 7105 additions and 693 deletions
@@ -379,7 +379,7 @@ export class EventController {
if (this.ctx.retryLoader) {
this.ctx.retryLoader.stop();
this.ctx.retryLoader = undefined;
this.ctx.statusContainer.clear();
this.ctx.statusContainer.disposeChildren();
}
this.#cancelIdleCompaction();
this.#cancelIdleRecap();
@@ -1083,7 +1083,7 @@ export class EventController {
if (this.ctx.loadingAnimation) {
this.ctx.loadingAnimation.stop();
this.ctx.loadingAnimation = undefined;
this.ctx.statusContainer.clear();
this.ctx.statusContainer.disposeChildren();
}
if (this.ctx.streamingComponent) {
this.ctx.chatContainer.removeChild(this.ctx.streamingComponent);
@@ -1126,9 +1126,9 @@ export class EventController {
/**
* Tear down the live "Working…" loader: stop its animation timer AND clear the
* reference. A transient overlay (auto-compaction / auto-retry) that only ran
* `statusContainer.clear()` detached the loader from the container but left
* `ctx.loadingAnimation` set, so the resumed turn's `agent_start` →
* reference. A transient overlay (auto-compaction / auto-retry) can remove the
* loader from the container while leaving `ctx.loadingAnimation` set, so the
* resumed turn's `agent_start` →
* `ensureLoadingAnimation()` (guarded by `if (!this.loadingAnimation)`) skipped
* re-adding it and the spinner vanished while the agent kept streaming. Nulling
* the reference here lets the next `agent_start` recreate and re-attach it.
@@ -1169,7 +1169,7 @@ export class EventController {
this.#cancelIdleRecap();
this.#setTerminalProgress(true);
this.#stopWorkingLoader();
this.ctx.statusContainer.clear();
this.ctx.statusContainer.disposeChildren();
const reasonText =
event.reason === "overflow"
? "Context overflow detected, "
@@ -1204,7 +1204,7 @@ export class EventController {
if (this.ctx.autoCompactionLoader) {
this.ctx.autoCompactionLoader.stop();
this.ctx.autoCompactionLoader = undefined;
this.ctx.statusContainer.clear();
this.ctx.statusContainer.disposeChildren();
}
const isHandoffAction = event.action === "handoff";
const isShakeAction = event.action === "shake";
@@ -1246,12 +1246,12 @@ export class EventController {
} else if (event.errorMessage) {
this.ctx.showWarning(event.errorMessage);
} else if (isHandoffAction) {
this.ctx.chatContainer.clear();
this.ctx.clearTransientSessionUi();
this.ctx.lastAssistantUsage = undefined;
this.ctx.rebuildChatFromMessages();
this.ctx.renderInitialMessages();
this.ctx.statusLine.invalidate();
this.ctx.ui.requestRender();
await this.ctx.reloadTodos();
this.ctx.ui.requestRender(true, { clearScrollback: true });
this.ctx.showStatus("Auto-handoff completed");
} else if (event.skipped) {
// Benign skip: no model selected, no candidate models available, or nothing
@@ -1269,7 +1269,7 @@ export class EventController {
async #handleAutoRetryStart(event: Extract<AgentSessionEvent, { type: "auto_retry_start" }>): Promise<void> {
this.#trackRetrySupersededAssistantComponent(this.#lastAssistantComponent);
this.#stopWorkingLoader();
this.ctx.statusContainer.clear();
this.ctx.statusContainer.disposeChildren();
if (AIError.is(event.errorId, AIError.Flag.ThinkingLoop)) {
// The retry path drops the failed assistant from runtime context. Do not
// restore its inline Error row; just unpin the fixed-region banner so the
@@ -1293,7 +1293,7 @@ export class EventController {
if (this.ctx.retryLoader) {
this.ctx.retryLoader.stop();
this.ctx.retryLoader = undefined;
this.ctx.statusContainer.clear();
this.ctx.statusContainer.disposeChildren();
}
if (event.success) {
let appliedRecovered = false;