fix(runner): preserve native work through controller outages (#17594)

Keep remote native work under its authenticated connection lease through controller outages. Hold durable ACPX tools through reconnection, align the native Claude HTTP MCP client budget, and wait for the recovered handler before dispatch. Preserve Stop, cancellation, exact identity and artifact checks.

Verified with real-process regressions and a real Claude Opus 5.5 Daytona workflow: 125 seconds offline during useful work, original process and lease retained, no failed native tool calls, queued follow-up completed, independently verified ZIP and committed workspace receipts. All current-head CI gates pass and Greptile is 5/5 with all findings resolved.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-10-25 09:01:24 -05:00
1 parent 3536b3649f
commit aec86c794b
37 files changed
+628 -75

No files matched your search

@@ -11999,7 +11999,8 @@ async function createRunnerdBackendWithinSessionClaim(
claudeEffort: "claudeEffort" in provider ? provider.claudeEffort : undefined,
acpxPermissionModePinned: true } : {}),
...(provider.kind === "opencode" ? { opencodePermissionMode: provider.permissionMode } : {}),
runnerReconnectGraceMs: 120_000, lifecyclePolicy: input.execution.session.lifecyclePolicy,
runnerReconnectGraceMs: 120_000, runnerProcessReconnectGraceMs: null,
lifecyclePolicy: input.execution.session.lifecyclePolicy,
runtimeContext: "runtimeContext" in input.execution ? input.execution.runtimeContext : null,
externallySandboxed: true, baseInstructions: recovery?.baseInstructions,
resumeDynamicTools: dynamicTools, resumeCompletionContract: { revision: input.execution.completionContract.contract.revision,
@@ -13494,6 +13495,10 @@ async function createRunnerdBackendWithinSessionClaim(
? resolveSourceCodexHome(resolveNativeProviderEnvironment(input.execution.provider, runnerEnvironment))
: undefined,
runnerReconnectGraceMs: remoteTarget ? 120_000 : undefined,
// A controller's bounded reconnect attempt is not the remote owner's
// lifetime. Retain it through restarts until its authenticated lease
// expires or explicit Stop/suspension proves that execution ended.
runnerProcessReconnectGraceMs: remoteTarget ? null : undefined,
environment: effectiveRunnerEnvironment,
observability: input.observability,
onDiagnostic: (message) => {