fix: keep CI SSH uploads below provider limits

This commit is contained in:
Codex
2026-06-11 10:42:52 +00:00
parent 63030fa255
commit 8b13c01d46
3 changed files with 15 additions and 1 deletions
+5 -1
View File
@@ -548,6 +548,8 @@ function chunks(value: string, size: number): string[] {
return result;
}
const hostSshBase64UploadChunkChars = 3000;
function asRecord(value: unknown): Record<string, unknown> | null {
return typeof value === "object" && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : null;
}
@@ -970,7 +972,9 @@ async function uploadRemoteBase64(path: string, encoded: string, target = ciTarg
"chmod 600 \"$target\"",
].join("\n"), 20_000, 10_000, true, target);
if (!init.ok) return init;
for (const chunk of chunks(encoded, 6_000)) {
// D601 provider-gateway rejects long host.ssh commands; keep each append
// envelope comfortably below the transport limit.
for (const chunk of chunks(encoded, hostSshBase64UploadChunkChars)) {
const append = await dispatchSsh([
"set -euo pipefail",
`target=${shellQuote(path)}`,