fix: use fs backend for host apply-patch

This commit is contained in:
Codex
2026-06-26 18:12:44 +00:00
parent c8fb148db3
commit 590feb7d9f
7 changed files with 175 additions and 20 deletions
+4 -4
View File
@@ -1179,7 +1179,7 @@ export function formatApplyPatchV2BulkReplacementPayload(paths: Iterable<string>
return { targets, payload: `${records.join("\n")}\n` };
}
type RemoteV2Operation =
export type ApplyPatchV2RemoteOperation =
| "stat"
| "read-b64-block"
| "read-bulk-b64"
@@ -1191,11 +1191,11 @@ type RemoteV2Operation =
| "write-b64-commit"
| "delete";
async function checkedRemoteV2(executor: ApplyPatchV2Executor, operation: RemoteV2Operation, args: string[], input?: string): Promise<{ stdout: string }> {
async function checkedRemoteV2(executor: ApplyPatchV2Executor, operation: ApplyPatchV2RemoteOperation, args: string[], input?: string): Promise<{ stdout: string }> {
if (!executor.run) {
throw new ApplyPatchV2Error("remote apply-patch v2 executor does not provide a command runner", { operation, args });
}
const result = await executor.run(remoteV2Script(operation, args), input);
const result = await executor.run(applyPatchV2RemoteCommand(operation, args), input);
if (result.exitCode === 0) return result;
throw new ApplyPatchV2Error("remote apply-patch v2 operation failed", {
operation,
@@ -1206,7 +1206,7 @@ async function checkedRemoteV2(executor: ApplyPatchV2Executor, operation: Remote
});
}
function remoteV2Script(operation: RemoteV2Operation, args: string[]): string[] {
export function applyPatchV2RemoteCommand(operation: ApplyPatchV2RemoteOperation, args: string[]): string[] {
const script = [
"set -eu",
"sha256_file() {",