add branch/compact retries to agent-harness

This commit is contained in:
David Brailovsky
2026-07-21 12:11:39 +00:00
parent 8e53e0e49c
commit 162179af5a
10 changed files with 354 additions and 67 deletions
@@ -164,7 +164,7 @@ export type AgentSessionEvent =
| { type: "auto_retry_start"; attempt: number; maxAttempts: number; delayMs: number; errorMessage: string }
| { type: "auto_retry_end"; success: boolean; attempt: number; finalError?: string }
| {
type: "summarization_retry_start";
type: "summarization_retry_scheduled";
attempt: number;
maxAttempts: number;
delayMs: number;
@@ -176,7 +176,7 @@ export type AgentSessionEvent =
source: "compaction";
reason: "manual" | "threshold" | "overflow";
}
| { type: "summarization_retry_end" };
| { type: "summarization_retry_finished" };
/** Listener function for agent session events */
export type AgentSessionEventListener = (event: AgentSessionEvent) => void;
@@ -2649,9 +2649,9 @@ export class AgentSession {
source: { source: "branchSummary" } | { source: "compaction"; reason: "manual" | "threshold" | "overflow" },
): RetryCallbacks {
return {
onRetry: (attempt, maxAttempts, delayMs, errorMessage) => {
onRetryScheduled: (attempt, maxAttempts, delayMs, errorMessage) => {
this._emit({
type: "summarization_retry_start",
type: "summarization_retry_scheduled",
attempt,
maxAttempts,
delayMs,
@@ -2664,8 +2664,8 @@ export class AgentSession {
...source,
});
},
onRetryEnd: () => {
this._emit({ type: "summarization_retry_end" });
onRetryFinished: () => {
this._emit({ type: "summarization_retry_finished" });
},
};
}
@@ -3111,7 +3111,7 @@ export class InteractiveMode {
break;
}
case "summarization_retry_start": {
case "summarization_retry_scheduled": {
this.showError(event.errorMessage);
this.showStatusIndicator(
new RetryStatusIndicator(this.ui, event.attempt, event.maxAttempts, event.delayMs),
@@ -3131,7 +3131,7 @@ export class InteractiveMode {
break;
}
case "summarization_retry_end": {
case "summarization_retry_finished": {
this.clearStatusIndicator("retry");
this.ui.requestRender();
break;