add branch/compact retries to agent-harness
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user