diff --git a/src/agents/command-poll-backoff.runtime.ts b/src/agents/command-poll-backoff.runtime.ts index 86055b20150f..ba22543a6ca1 100644 --- a/src/agents/command-poll-backoff.runtime.ts +++ b/src/agents/command-poll-backoff.runtime.ts @@ -1,6 +1,8 @@ +/** + * Runtime seam for command poll backoff cleanup. + */ import { pruneStaleCommandPolls as pruneStaleCommandPollsImpl } from "./command-poll-backoff.js"; -// Runtime seam for command poll backoff cleanup. type PruneStaleCommandPolls = typeof import("./command-poll-backoff.js").pruneStaleCommandPolls; /** Prune stale command polls using the production backoff implementation. */ diff --git a/src/agents/compaction-planning-worker.ts b/src/agents/compaction-planning-worker.ts index 94cd99fdb110..aac018363265 100644 --- a/src/agents/compaction-planning-worker.ts +++ b/src/agents/compaction-planning-worker.ts @@ -1,3 +1,7 @@ +/** + * Runs CPU-heavy compaction planning in a worker thread when histories are + * large enough to risk starving the main event loop. + */ import path from "node:path"; import { fileURLToPath, pathToFileURL } from "node:url"; import { Worker } from "node:worker_threads"; @@ -191,6 +195,7 @@ async function runWithUnavailableFallback; @@ -420,6 +426,7 @@ export async function summarizeForHandoff(params: { }); } +/** Resolves a positive context-window token count from model metadata. */ export function resolveContextWindowTokens(model?: ExtensionContext["model"]): number { const effective = (model as { contextTokens?: number } | undefined)?.contextTokens ?? model?.contextWindow;