Skip to content

Commit bb673f4

Browse files
committed
refactor: share agent run snapshot shape
1 parent 16ef9c1 commit bb673f4

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

src/gateway/server-methods/agent-job.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
} from "../../agents/agent-run-terminal-outcome.js";
66
import { onAgentEvent } from "../../infra/agent-events.js";
77
import { setSafeTimeout } from "../../utils/timer-delay.js";
8+
import type { AgentWaitTerminalSnapshot } from "./agent-wait-dedupe.js";
89

910
const AGENT_RUN_CACHE_TTL_MS = 10 * 60_000;
1011
/**
@@ -28,18 +29,8 @@ const pendingAgentRunTimeouts = new Map<string, PendingAgentRunTerminal>();
2829
const agentRunWaiterCounts = new Map<string, number>();
2930
let agentRunListenerStarted = false;
3031

31-
type AgentRunSnapshot = {
32+
type AgentRunSnapshot = AgentWaitTerminalSnapshot & {
3233
runId: string;
33-
status: "ok" | "error" | "timeout";
34-
startedAt?: number;
35-
endedAt?: number;
36-
error?: string;
37-
stopReason?: string;
38-
livenessState?: string;
39-
yielded?: boolean;
40-
pendingError?: boolean;
41-
timeoutPhase?: AgentRunTerminalOutcome["timeoutPhase"];
42-
providerStarted?: boolean;
4334
ts: number;
4435
};
4536

0 commit comments

Comments
 (0)