From cd8b289f2fd5d57ee4c5a840366d052be7d5965b Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Wed, 21 Oct 2026 13:18:20 -0700 Subject: [PATCH] chore(runtime): delete exports nothing reads (#31639) flushDurableStateOrThrowAsync and six exported types (AgentSessionSpawnTokenScanEvidence, FreshExplicitAgentStatus, LiveTerminalPty, RemoteStartReceipt, WorkerStartMode(Reason), WorktreeTeardownStopPty) had no reader anywhere in src, mobile, config or tests. --- .../loading-store/write-flush-barriers.ts | 23 ------------------- .../agent-session-spawn-token-process-scan.ts | 4 ---- .../orchestration-worker-start-mode.ts | 4 ---- .../federated-worker-start-receipts.ts | 15 ------------ .../runtime-hook-agent-row-selection.ts | 2 -- .../terminal/query/pty-terminal-summary.ts | 4 ---- .../runtime/worktree-pty-surface-sweeps.ts | 5 ---- 7 files changed, 57 deletions(-) diff --git a/src/main/persistence/loading-store/write-flush-barriers.ts b/src/main/persistence/loading-store/write-flush-barriers.ts index a2c43f3eb09..666fd759fa8 100644 --- a/src/main/persistence/loading-store/write-flush-barriers.ts +++ b/src/main/persistence/loading-store/write-flush-barriers.ts @@ -137,29 +137,6 @@ export class WriteFlushBarrierOperations { } } -export async function flushDurableStateOrThrowAsync( - owner: WriteFlushBarrierOperations -): Promise { - const { runtime, writes } = owner[writeFlushBarrierOperationsContext] - if (runtime.writesFrozen || runtime.profileMaintenancePending || runtime.quitFlushStarted) { - throw new Error('Cannot flush while persistence is finalized') - } - return runProfileStateFlush(runtime, async () => { - for (;;) { - if (runtime.writeTimer) { - clearTimeout(runtime.writeTimer) - runtime.writeTimer = null - } - runtime.firstPendingSaveAt = null - const generation = runtime.writeGeneration - await enqueueWrite(writes) - if (generation === runtime.writeGeneration) { - break - } - } - }) -} - export async function flushCurrentStateAsync( owner: WriteFlushBarrierOperations, { diff --git a/src/main/runtime/agent-session-spawn-token-process-scan.ts b/src/main/runtime/agent-session-spawn-token-process-scan.ts index c402cfc93e7..d13a93f7fde 100644 --- a/src/main/runtime/agent-session-spawn-token-process-scan.ts +++ b/src/main/runtime/agent-session-spawn-token-process-scan.ts @@ -14,10 +14,6 @@ import { spawnTokenFromEnvironBlock } from './agent-session-spawn-token-readback export type AgentSessionSpawnTokenScan = ReadonlyMap -export type AgentSessionSpawnTokenScanEvidence = - | { status: 'verified'; processes: AgentSessionSpawnTokenScan } - | { status: 'unverifiable'; processes: null; platform: NodeJS.Platform } - /** Tokens observed on this host, or null when the platform cannot answer at all. */ export async function scanAgentSessionSpawnTokenProcesses( platform: NodeJS.Platform = process.platform, diff --git a/src/main/runtime/rpc/methods/orchestration-worker-start-mode.ts b/src/main/runtime/rpc/methods/orchestration-worker-start-mode.ts index cffb8053e72..f3e35ec244a 100644 --- a/src/main/runtime/rpc/methods/orchestration-worker-start-mode.ts +++ b/src/main/runtime/rpc/methods/orchestration-worker-start-mode.ts @@ -12,8 +12,6 @@ import { downgradeAgentLaunchModeForHost, readAgentLaunchModeSettings, resolveAgentLaunchModeOnHost, - type AgentLaunchMode, - type AgentLaunchModeReason, type AgentLaunchModeReceipt, type AgentLaunchModeSettings, type AgentLaunchModeVocabulary @@ -21,8 +19,6 @@ import { import type { TuiAgent } from '../../../../shared/tui-agent' import type { OrcaRuntimeService } from '../../orca-runtime' -export type WorkerStartMode = AgentLaunchMode -export type WorkerStartModeReason = AgentLaunchModeReason export type WorkerStartModeReceipt = AgentLaunchModeReceipt /** Orchestration's receipts are read next to dispatch records, so they name the worker and the diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start-receipts.ts b/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start-receipts.ts index 271d2ee90c3..3cdd39c7a50 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start-receipts.ts +++ b/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start-receipts.ts @@ -1,20 +1,5 @@ import type { OrchestrationWorkerLaunchReceipt } from '../worker/worker-launch-preferences' -export type RemoteStartReceipt = { - dispatchId: string - state: string - runtimeEpoch: string - worktreeId?: string - terminalHandle?: string - setup?: { state: string } - launch?: OrchestrationWorkerLaunchReceipt - effects?: unknown[] - residualResources?: unknown[] - prompt?: unknown - failedStage?: string - lastError?: string -} - export function isKnownRemoteStartFailure(code: string): boolean { return [ 'invalid_argument', diff --git a/src/main/runtime/runtime-hook-agent-row-selection.ts b/src/main/runtime/runtime-hook-agent-row-selection.ts index 0c675fee0cd..7409eff4809 100644 --- a/src/main/runtime/runtime-hook-agent-row-selection.ts +++ b/src/main/runtime/runtime-hook-agent-row-selection.ts @@ -71,8 +71,6 @@ export function selectFreshExplicitAgentStatusRow(args: HookRowJoin): AgentStatu return best } -export type FreshExplicitAgentStatus = ReturnType - /** The freshest explicit state for a terminal, matched on its handle or its pane key. */ export function selectFreshExplicitAgentStatus(args: { handle: string diff --git a/src/main/runtime/terminal/query/pty-terminal-summary.ts b/src/main/runtime/terminal/query/pty-terminal-summary.ts index 980c91247aa..e2eb0603457 100644 --- a/src/main/runtime/terminal/query/pty-terminal-summary.ts +++ b/src/main/runtime/terminal/query/pty-terminal-summary.ts @@ -21,10 +21,6 @@ import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/layout-owner-switc import { startedMainTerminalSurfaces } from '../surface/main-terminal-surfaces' import { HEADLESS_RUNTIME_WINDOW_ID } from '../../../../shared/runtime-types' -export type LiveTerminalPty = ReturnType< - OrcaRuntimeWithBuildPtyTerminalSummary['getLivePtyForHandle'] -> - export abstract class OrcaRuntimeWithBuildPtyTerminalSummary extends OrcaRuntimeWithGetPtyRecordForPaneKey { protected abstract bindPtyIncarnationHandle( retained: PtyIncarnationHandleRecord, diff --git a/src/main/runtime/worktree-pty-surface-sweeps.ts b/src/main/runtime/worktree-pty-surface-sweeps.ts index 86891b72b83..b1dd5692282 100644 --- a/src/main/runtime/worktree-pty-surface-sweeps.ts +++ b/src/main/runtime/worktree-pty-surface-sweeps.ts @@ -17,11 +17,6 @@ import { teardownRpcDeadline } from './worktree-teardown-deadline' // or pathological inventory cannot fan out unbounded provider/RPC shutdowns. const WORKTREE_TEARDOWN_CONCURRENCY = 32 -export type WorktreeTeardownStopPty = ( - ptyId: string, - stop: () => Promise -) => Promise<{ stopped: boolean; owner: boolean }> - export async function sweepProviderByPrefix( worktreeId: string, provider: IPtyProvider,