fix(coding-agent): handle auto-compaction failures gracefully

When auto-compaction fails (e.g., quota exceeded), emit the error via
the auto_compaction_end event instead of throwing. The UI now displays
the error message, allowing users to take action (switch models, wait
for quota reset, etc.) instead of crashing.

fixes #792
This commit is contained in:
Mario Zechner 2026-01-16 23:13:26 +01:00
parent 5c59caee4e
commit 20f5fcc79d
4 changed files with 25 additions and 8 deletions

View file

@ -1820,6 +1820,10 @@ export class InteractiveMode {
timestamp: Date.now(),
});
this.footer.invalidate();
} else if (event.errorMessage) {
// Compaction failed (e.g., quota exceeded, API error)
this.chatContainer.addChild(new Spacer(1));
this.chatContainer.addChild(new Text(theme.fg("error", event.errorMessage), 1, 0));
}
void this.flushCompactionQueue({ willRetry: event.willRetry });
this.ui.requestRender();