refactor(agents): hide stale run cutoff

This commit is contained in:
Vincent Koc
2026-06-17 10:36:06 +08:00
parent 788eb2e3bf
commit 16142bebd8
4 changed files with 7 additions and 4 deletions

View File

@@ -12,7 +12,8 @@ import {
resetSubagentRegistryForTests,
} from "./subagent-registry.test-helpers.js";
import type { SubagentRunRecord } from "./subagent-registry.types.js";
import { STALE_UNENDED_SUBAGENT_RUN_MS } from "./subagent-run-liveness.js";
const STALE_UNENDED_SUBAGENT_RUN_MS = 2 * 60 * 60 * 1_000;
let testWorkspaceDir = os.tmpdir();

View File

@@ -12,7 +12,8 @@ import {
shouldIgnorePostCompletionAnnounceForSessionFromRuns,
} from "./subagent-registry-queries.js";
import type { SubagentRunRecord } from "./subagent-registry.types.js";
import { STALE_UNENDED_SUBAGENT_RUN_MS } from "./subagent-run-liveness.js";
const STALE_UNENDED_SUBAGENT_RUN_MS = 2 * 60 * 60 * 1_000;
function makeRun(overrides: Partial<SubagentRunRecord>): SubagentRunRecord {
const runId = overrides.runId ?? "run-default";

View File

@@ -5,10 +5,11 @@ import {
isLiveUnendedSubagentRun,
RECENT_ENDED_SUBAGENT_CHILD_SESSION_MS,
isStaleUnendedSubagentRun,
STALE_UNENDED_SUBAGENT_RUN_MS,
shouldKeepSubagentRunChildLink,
} from "./subagent-run-liveness.js";
const STALE_UNENDED_SUBAGENT_RUN_MS = 2 * 60 * 60 * 1_000;
describe("subagent run liveness", () => {
const now = Date.parse("2026-04-25T12:00:00Z");

View File

@@ -7,7 +7,7 @@ import type { SubagentRunRecord } from "./subagent-registry.types.js";
import { resolveSubagentRunDurationMs } from "./subagent-run-timeout.js";
import { getSubagentSessionStartedAt } from "./subagent-session-metrics.js";
export const STALE_UNENDED_SUBAGENT_RUN_MS = 2 * 60 * 60 * 1_000;
const STALE_UNENDED_SUBAGENT_RUN_MS = 2 * 60 * 60 * 1_000;
export const RECENT_ENDED_SUBAGENT_CHILD_SESSION_MS = 30 * 60 * 1_000;
const EXPLICIT_TIMEOUT_STALE_GRACE_MS = 60_000;
const MIN_REALISTIC_RUN_TIMESTAMP_MS = Date.UTC(2020, 0, 1);