fix: preserve native sessions and route Git credentials internally

Align durable journal validation with the transport bound, preserve authorization on cached storage clients, and avoid Cloud session gates for native Git callbacks.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-09-08 16:32:40 -05:00
1 parent 40619e2e23
commit 62096fd335
6 files changed
+101 -17

No files matched your search

@@ -150,7 +150,10 @@ export async function detachNativeSessionsForRestart(
const MAX_REMOTE_CHECKPOINT_ARCHIVE_BYTES = 64 * 1024 * 1024;
const MAX_REMOTE_CHECKPOINT_EXPANDED_BYTES = 64 * 1024 * 1024;
const MAX_REMOTE_CHECKPOINT_ENTRIES = 20_000;
const NATIVE_DURABLE_IDENTITY_MAX_BYTES = 2 * 1024 * 1024;
// This file contains the PRP journal as well as its identity. Match the
// runner transport's 64 MiB control-plane state bound; ordinary tool output
// can exceed 2 MiB without invalidating the session identity.
const NATIVE_CONTROL_PLANE_STATE_MAX_BYTES = 64 * 1024 * 1024;
const NATIVE_RUNNER_STATE_MAX_BYTES = 16 * 1024 * 1024;
const NATIVE_WARM_CHECKPOINT_MAX_BYTES = 8 * 1024 * 1024;
const CODEX_HOME_NON_PERSISTENT_ENTRIES = [
@@ -1712,7 +1715,7 @@ export function runnerdStateProvesIncompleteBootstrap(root: string): boolean {
JSON.parse(
readBoundedNativeFile(
statePath,
NATIVE_DURABLE_IDENTITY_MAX_BYTES,
NATIVE_CONTROL_PLANE_STATE_MAX_BYTES,
"runner_durable_identity_too_large",
).toString("utf8"),
),
@@ -1765,7 +1768,7 @@ function readRunnerdDurableIdentity(
JSON.parse(
readBoundedNativeFile(
statePath,
NATIVE_DURABLE_IDENTITY_MAX_BYTES,
NATIVE_CONTROL_PLANE_STATE_MAX_BYTES,
"runner_durable_identity_too_large",
).toString("utf8"),
),