@tickernelz/wardmote-adapter-utils 2026.1109.0 → 2026.1111.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/acpx-engine/composed-run-characterization.test.js +13 -16
- package/dist/acpx-engine/composed-run-characterization.test.js.map +1 -1
- package/dist/acpx-engine/ephemeral-session-environment.test.js +1 -1
- package/dist/acpx-engine/ephemeral-session-environment.test.js.map +1 -1
- package/dist/acpx-engine/execute-identity.test.js +3 -3
- package/dist/acpx-engine/execute-identity.test.js.map +1 -1
- package/dist/acpx-engine/execute.d.ts +2 -28
- package/dist/acpx-engine/execute.d.ts.map +1 -1
- package/dist/acpx-engine/execute.js +135 -196
- package/dist/acpx-engine/execute.js.map +1 -1
- package/dist/acpx-engine/execute.test.js +171 -187
- package/dist/acpx-engine/execute.test.js.map +1 -1
- package/dist/acpx-engine/filesystem-protocol.test.js +1 -1
- package/dist/acpx-engine/filesystem-protocol.test.js.map +1 -1
- package/dist/acpx-engine/managed-codex-skills-manifest.d.ts +3 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.d.ts.map +1 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.js +30 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.js.map +1 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.test.d.ts +2 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.test.d.ts.map +1 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.test.js +29 -0
- package/dist/acpx-engine/managed-codex-skills-manifest.test.js.map +1 -0
- package/dist/acpx-engine/operator-stop.test.js +1 -1
- package/dist/acpx-engine/operator-stop.test.js.map +1 -1
- package/dist/acpx-engine/remote-spawn-smoke.test.js +5 -5
- package/dist/acpx-engine/remote-spawn-smoke.test.js.map +1 -1
- package/dist/acpx-engine/run-contracts.d.ts +5 -15
- package/dist/acpx-engine/run-contracts.d.ts.map +1 -1
- package/dist/acpx-engine/run-contracts.js.map +1 -1
- package/dist/acpx-engine/run-fault-matrix.test.js +7 -7
- package/dist/acpx-engine/run-fault-matrix.test.js.map +1 -1
- package/dist/acpx-engine/run-site-sandbox.d.ts +5 -12
- package/dist/acpx-engine/run-site-sandbox.d.ts.map +1 -1
- package/dist/acpx-engine/run-site-sandbox.js +4 -16
- package/dist/acpx-engine/run-site-sandbox.js.map +1 -1
- package/dist/acpx-engine/run-site-sandbox.test.js +10 -13
- package/dist/acpx-engine/run-site-sandbox.test.js.map +1 -1
- package/dist/acpx-engine/settlement-characterization.test.js +20 -20
- package/dist/acpx-engine/settlement-characterization.test.js.map +1 -1
- package/dist/acpx-engine/spawn-smoke.test.js +6 -6
- package/dist/acpx-engine/spawn-smoke.test.js.map +1 -1
- package/dist/acpx-engine/startup-characterization.test.js +14 -18
- package/dist/acpx-engine/startup-characterization.test.js.map +1 -1
- package/dist/acpx-engine/startup-timing.d.ts +27 -45
- package/dist/acpx-engine/startup-timing.d.ts.map +1 -1
- package/dist/acpx-engine/startup-timing.js +1 -19
- package/dist/acpx-engine/startup-timing.js.map +1 -1
- package/dist/acpx-engine/turn-characterization.test.js +3 -3
- package/dist/acpx-engine/turn-characterization.test.js.map +1 -1
- package/dist/acpx-engine/turn-sequence.js +1 -1
- package/dist/acpx-engine/turn-sequence.js.map +1 -1
- package/dist/chat-file-delivery.d.ts +2 -2
- package/dist/chat-file-delivery.d.ts.map +1 -1
- package/dist/chat-file-delivery.js +4 -4
- package/dist/chat-file-delivery.js.map +1 -1
- package/dist/chat-file-delivery.test.js +9 -9
- package/dist/chat-file-delivery.test.js.map +1 -1
- package/dist/command-managed-runtime.js +5 -5
- package/dist/command-managed-runtime.js.map +1 -1
- package/dist/command-managed-runtime.test.js +36 -38
- package/dist/command-managed-runtime.test.js.map +1 -1
- package/dist/directory-merge-lock.test.js +1 -1
- package/dist/directory-merge-lock.test.js.map +1 -1
- package/dist/execution-target-sandbox.test.js +259 -267
- package/dist/execution-target-sandbox.test.js.map +1 -1
- package/dist/execution-target-stdin-race.test.js +55 -65
- package/dist/execution-target-stdin-race.test.js.map +1 -1
- package/dist/execution-target.d.ts +6 -36
- package/dist/execution-target.d.ts.map +1 -1
- package/dist/execution-target.js +35 -86
- package/dist/execution-target.js.map +1 -1
- package/dist/execution-target.test.js +1 -1
- package/dist/execution-target.test.js.map +1 -1
- package/dist/forbidden-config-env.test.js +2 -2
- package/dist/forbidden-config-env.test.js.map +1 -1
- package/dist/git-workspace-sync.d.ts +2 -2
- package/dist/git-workspace-sync.d.ts.map +1 -1
- package/dist/git-workspace-sync.js +7 -7
- package/dist/git-workspace-sync.js.map +1 -1
- package/dist/git-workspace-sync.test.js +61 -61
- package/dist/git-workspace-sync.test.js.map +1 -1
- package/dist/github-launcher-environment.test.js +5 -5
- package/dist/github-launcher-environment.test.js.map +1 -1
- package/dist/github-launcher.js +8 -8
- package/dist/github-launcher.test.js +5 -5
- package/dist/github-launcher.test.js.map +1 -1
- package/dist/http2-bridge-server.test.js +1 -1
- package/dist/http2-bridge-server.test.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/local-process-sandbox.js +7 -7
- package/dist/local-process-sandbox.js.map +1 -1
- package/dist/local-process-sandbox.test.js +16 -16
- package/dist/local-process-sandbox.test.js.map +1 -1
- package/dist/mcp-isolation.integration.test.js +4 -4
- package/dist/mcp-isolation.integration.test.js.map +1 -1
- package/dist/prompt-sections.test.js +11 -11
- package/dist/prompt-sections.test.js.map +1 -1
- package/dist/provider-models/claude.d.ts +0 -1
- package/dist/provider-models/claude.d.ts.map +1 -1
- package/dist/provider-models/claude.js +0 -1
- package/dist/provider-models/claude.js.map +1 -1
- package/dist/remote-managed-runtime.js +6 -6
- package/dist/remote-managed-runtime.js.map +1 -1
- package/dist/remote-managed-runtime.test.js +14 -14
- package/dist/remote-managed-runtime.test.js.map +1 -1
- package/dist/retired-marker-names.d.ts +2 -0
- package/dist/retired-marker-names.d.ts.map +1 -0
- package/dist/retired-marker-names.js +2 -0
- package/dist/retired-marker-names.js.map +1 -0
- package/dist/retired-skill-names.d.ts +3 -0
- package/dist/retired-skill-names.d.ts.map +1 -0
- package/dist/retired-skill-names.js +8 -0
- package/dist/retired-skill-names.js.map +1 -0
- package/dist/runner-connectivity.d.ts +5 -5
- package/dist/runner-connectivity.d.ts.map +1 -1
- package/dist/runner-connectivity.js +11 -11
- package/dist/runner-connectivity.js.map +1 -1
- package/dist/runner-connectivity.test.js +21 -21
- package/dist/runner-connectivity.test.js.map +1 -1
- package/dist/runtime-progress.d.ts.map +1 -1
- package/dist/runtime-progress.js +1 -4
- package/dist/runtime-progress.js.map +1 -1
- package/dist/runtime-progress.test.js +13 -13
- package/dist/runtime-progress.test.js.map +1 -1
- package/dist/sandbox-callback-bridge.d.ts +1 -16
- package/dist/sandbox-callback-bridge.d.ts.map +1 -1
- package/dist/sandbox-callback-bridge.js +28 -61
- package/dist/sandbox-callback-bridge.js.map +1 -1
- package/dist/sandbox-callback-bridge.test.js +67 -88
- package/dist/sandbox-callback-bridge.test.js.map +1 -1
- package/dist/sandbox-file-sync.test.js +9 -9
- package/dist/sandbox-file-sync.test.js.map +1 -1
- package/dist/sandbox-managed-runtime.d.ts +0 -30
- package/dist/sandbox-managed-runtime.d.ts.map +1 -1
- package/dist/sandbox-managed-runtime.js +12 -34
- package/dist/sandbox-managed-runtime.js.map +1 -1
- package/dist/sandbox-managed-runtime.test.js +130 -140
- package/dist/sandbox-managed-runtime.test.js.map +1 -1
- package/dist/sandbox-run-log-stream.js +1 -1
- package/dist/sandbox-run-log-stream.js.map +1 -1
- package/dist/server-utils-env.test.js +8 -7
- package/dist/server-utils-env.test.js.map +1 -1
- package/dist/server-utils.d.ts +118 -144
- package/dist/server-utils.d.ts.map +1 -1
- package/dist/server-utils.js +243 -270
- package/dist/server-utils.js.map +1 -1
- package/dist/server-utils.test.js +274 -257
- package/dist/server-utils.test.js.map +1 -1
- package/dist/skill-library-manifest.d.ts +2 -2
- package/dist/skill-library-manifest.d.ts.map +1 -1
- package/dist/skill-library-manifest.test.js +4 -4
- package/dist/skill-library-manifest.test.js.map +1 -1
- package/dist/ssh-fixture.test.js +57 -57
- package/dist/ssh-fixture.test.js.map +1 -1
- package/dist/ssh.d.ts.map +1 -1
- package/dist/ssh.js +16 -38
- package/dist/ssh.js.map +1 -1
- package/dist/test-fixtures/prompt-context.d.ts +5 -5
- package/dist/test-fixtures/prompt-context.js +5 -5
- package/dist/test-fixtures/prompt-context.js.map +1 -1
- package/dist/tool-profile.d.ts +1 -1
- package/dist/tool-profile.d.ts.map +1 -1
- package/dist/tool-profile.js +1 -1
- package/dist/tool-profile.js.map +1 -1
- package/dist/types.d.ts +13 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/wardmote-mcp-mount.d.ts +9 -9
- package/dist/wardmote-mcp-mount.d.ts.map +1 -1
- package/dist/wardmote-mcp-mount.js +9 -9
- package/dist/wardmote-mcp-mount.js.map +1 -1
- package/dist/wardmote-mcp.d.ts +23 -25
- package/dist/wardmote-mcp.d.ts.map +1 -1
- package/dist/wardmote-mcp.js +32 -33
- package/dist/wardmote-mcp.js.map +1 -1
- package/dist/wardmote-mcp.test.js +52 -52
- package/dist/wardmote-mcp.test.js.map +1 -1
- package/dist/wardmote-runner-permissions.d.ts +14 -19
- package/dist/wardmote-runner-permissions.d.ts.map +1 -1
- package/dist/wardmote-runner-permissions.js +8 -13
- package/dist/wardmote-runner-permissions.js.map +1 -1
- package/dist/wardmote-runner-permissions.test.js +32 -32
- package/dist/wardmote-runner-permissions.test.js.map +1 -1
- package/dist/workspace-git-stream.test.js +1 -1
- package/dist/workspace-git-stream.test.js.map +1 -1
- package/dist/workspace-manifest.test.js +3 -3
- package/dist/workspace-manifest.test.js.map +1 -1
- package/dist/workspace-restore-diagnostics.js +1 -1
- package/dist/workspace-restore-diagnostics.js.map +1 -1
- package/dist/workspace-restore-diagnostics.test.js +5 -5
- package/dist/workspace-restore-diagnostics.test.js.map +1 -1
- package/dist/workspace-restore-merge.js +3 -3
- package/dist/workspace-restore-merge.js.map +1 -1
- package/dist/workspace-restore-merge.test.js +50 -56
- package/dist/workspace-restore-merge.test.js.map +1 -1
- package/dist/workspace-restore-result.test.js +2 -2
- package/dist/workspace-restore-result.test.js.map +1 -1
- package/dist/workspace-restore-teardown.test.js +6 -6
- package/dist/workspace-restore-teardown.test.js.map +1 -1
- package/package.json +2 -2
|
@@ -12,7 +12,7 @@ import { promisify } from "node:util";
|
|
|
12
12
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
13
13
|
import { getSandboxDuplexGatewayCodecSource } from "./sandbox-callback-bridge.js";
|
|
14
14
|
import { createBridgeBodyReservation, getBridgeBodyReservedBytesForTest, resetBridgeBodyReservationsForTest, HTTP2_BRIDGE_MAX_CONCURRENT_STREAMS, HTTP2_BRIDGE_MAX_PROCESS_BODY_BYTES, } from "./http2-bridge-server.js";
|
|
15
|
-
import { __duplexReadinessTesting, __http2PrefaceScanTesting, DEFAULT_REMOTE_SANDBOX_ADAPTER_TIMEOUT_SEC, adapterExecutionTargetDuplexObservabilityRecorder, adapterExecutionTargetEnablesSandboxDuplexBridge, adapterExecutionTargetSessionIdentity, adapterExecutionTargetToRemoteSpec,
|
|
15
|
+
import { __duplexReadinessTesting, __http2PrefaceScanTesting, DEFAULT_REMOTE_SANDBOX_ADAPTER_TIMEOUT_SEC, adapterExecutionTargetDuplexObservabilityRecorder, adapterExecutionTargetEnablesSandboxDuplexBridge, adapterExecutionTargetSessionIdentity, adapterExecutionTargetToRemoteSpec, adapterExecutionTargetUsesWardmoteBridge, ensureAdapterExecutionTargetCommandResolvable, formatAdapterExecutionTimeoutErrorMessage, formatAdapterExecutionTimeoutStartLogLine, parseAdapterExecutionTarget, postedIssueCommentLogMarker, resolveAdapterExecutionTargetTimeout, resolveAdapterExecutionTargetTimeoutSec, runAdapterExecutionTargetProcess, runAdapterExecutionTargetShellCommand, startAdapterExecutionTargetProcessSessionBridge, startAdapterExecutionTargetWardmoteBridge, } from "./execution-target.js";
|
|
16
16
|
import { createRuntimeSpanRunner, getActiveStepContext, } from "./acpx-engine/startup-timing.js";
|
|
17
17
|
import { createSandboxRunLogTailFactory } from "./sandbox-run-log-stream.js";
|
|
18
18
|
import { runChildProcess } from "./server-utils.js";
|
|
@@ -287,7 +287,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
287
287
|
});
|
|
288
288
|
});
|
|
289
289
|
it("preserves stdin when wrapping sandbox adapter commands for run-log streaming", async () => {
|
|
290
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
290
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-run-log-stdin-"));
|
|
291
291
|
cleanupDirs.push(rootDir);
|
|
292
292
|
const target = {
|
|
293
293
|
kind: "remote",
|
|
@@ -298,7 +298,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
298
298
|
streamRunLogs: true,
|
|
299
299
|
runner: createLocalSandboxRunner(),
|
|
300
300
|
};
|
|
301
|
-
const logsDir = path.posix.join(rootDir, ".
|
|
301
|
+
const logsDir = path.posix.join(rootDir, ".wardmote-runtime", "bridge", "logs");
|
|
302
302
|
const runLogTail = createSandboxRunLogTailFactory({
|
|
303
303
|
runner: target.runner,
|
|
304
304
|
remoteCwd: rootDir,
|
|
@@ -320,7 +320,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
320
320
|
expect(combinedStream(events, "stdout")).toContain("stdin=hello-through-wrapper");
|
|
321
321
|
});
|
|
322
322
|
it("creates the process session directories only in the launch exec, not in upfront makeDir execs", async () => {
|
|
323
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
323
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-makedir-"));
|
|
324
324
|
cleanupDirs.push(rootDir);
|
|
325
325
|
const childPath = path.join(rootDir, "noop-acp-child.mjs");
|
|
326
326
|
await writeFile(childPath, "process.stdin.on('data', () => {});\n", "utf8");
|
|
@@ -343,7 +343,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
343
343
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
344
344
|
runId: "run-process-session-makedir",
|
|
345
345
|
target,
|
|
346
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
346
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
347
347
|
adapterKey: "acpx",
|
|
348
348
|
command: process.execPath,
|
|
349
349
|
args: [childPath],
|
|
@@ -369,7 +369,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
369
369
|
{ outputMode: "polled", streamOutputViaSession: false },
|
|
370
370
|
{ outputMode: "streamed", streamOutputViaSession: true },
|
|
371
371
|
])("preserves an explicit remote PATH equal to host PATH in $outputMode mode", async ({ outputMode, streamOutputViaSession }) => {
|
|
372
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), `
|
|
372
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), `wardmote-process-session-${outputMode}-path-`));
|
|
373
373
|
cleanupDirs.push(rootDir);
|
|
374
374
|
const childPath = path.join(rootDir, "print-path-child.mjs");
|
|
375
375
|
await writeFile(childPath, 'process.stdout.write(process.env.PATH ?? "<missing>");\n', "utf8");
|
|
@@ -398,7 +398,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
398
398
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
399
399
|
runId: `run-process-session-${outputMode}-path`,
|
|
400
400
|
target,
|
|
401
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
401
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
402
402
|
adapterKey: "acpx",
|
|
403
403
|
command: process.execPath,
|
|
404
404
|
args: [childPath],
|
|
@@ -419,7 +419,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
419
419
|
}
|
|
420
420
|
});
|
|
421
421
|
it.each([false, true])("launches a large environment without oversized exec arguments (streamed=%s)", async (streamOutputViaSession) => {
|
|
422
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
422
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-large-process-env-"));
|
|
423
423
|
cleanupDirs.push(rootDir);
|
|
424
424
|
const value = "x".repeat(110_000);
|
|
425
425
|
const childPath = path.join(rootDir, "child.mjs");
|
|
@@ -445,7 +445,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
445
445
|
return delegate.execute(input);
|
|
446
446
|
},
|
|
447
447
|
};
|
|
448
|
-
const runtimeRootDir = path.join(rootDir, ".
|
|
448
|
+
const runtimeRootDir = path.join(rootDir, ".wardmote-runtime");
|
|
449
449
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
450
450
|
runId: "large-process-env", adapterKey: "acpx", runtimeRootDir,
|
|
451
451
|
target: { kind: "remote", transport: "sandbox", providerKey: "local-test", remoteCwd: rootDir, runner },
|
|
@@ -468,7 +468,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
468
468
|
}
|
|
469
469
|
});
|
|
470
470
|
it("logs a streamed wrapper launch failure before forwarding its exit", async () => {
|
|
471
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
471
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-wrapper-launch-error-"));
|
|
472
472
|
cleanupDirs.push(rootDir);
|
|
473
473
|
const delegate = createLocalSandboxRunner();
|
|
474
474
|
const logs = [];
|
|
@@ -495,7 +495,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
495
495
|
}
|
|
496
496
|
}, 10_000);
|
|
497
497
|
it("removes an incomplete private command payload when upload fails", async () => {
|
|
498
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
498
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-payload-upload-error-"));
|
|
499
499
|
cleanupDirs.push(rootDir);
|
|
500
500
|
const delegate = createLocalSandboxRunner();
|
|
501
501
|
await expect(startAdapterExecutionTargetProcessSessionBridge({
|
|
@@ -503,7 +503,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
503
503
|
target: {
|
|
504
504
|
kind: "remote", transport: "sandbox", providerKey: "local-test", remoteCwd: rootDir,
|
|
505
505
|
runner: { execute: async (input) => {
|
|
506
|
-
if (/command\.b64\.[^/]+\.
|
|
506
|
+
if (/command\.b64\.[^/]+\.wardmote-upload\.b64/.test(input.args?.[1] ?? "") && input.args[1].includes(">>")) {
|
|
507
507
|
throw new Error("Upload interrupted");
|
|
508
508
|
}
|
|
509
509
|
return delegate.execute(input);
|
|
@@ -522,7 +522,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
522
522
|
{ streamed: true, corrupt: false },
|
|
523
523
|
{ streamed: true, corrupt: true },
|
|
524
524
|
])("reports payload read failures without hanging (streamed=$streamed, corrupt=$corrupt)", async ({ streamed, corrupt }) => {
|
|
525
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
525
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-payload-read-error-"));
|
|
526
526
|
cleanupDirs.push(rootDir);
|
|
527
527
|
const delegate = createLocalSandboxRunner();
|
|
528
528
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
@@ -563,7 +563,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
563
563
|
// that token. This test drives the bridge with a getter that returns a known
|
|
564
564
|
// token, lets the first poll tick fire, and proves the poll exec reads that
|
|
565
565
|
// token from the active step store.
|
|
566
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
566
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-poll-parent-"));
|
|
567
567
|
cleanupDirs.push(rootDir);
|
|
568
568
|
const childPath = path.join(rootDir, "noop-acp-child.mjs");
|
|
569
569
|
await writeFile(childPath, "process.stdin.on('data', () => {});\n", "utf8");
|
|
@@ -598,7 +598,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
598
598
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
599
599
|
runId: "run-process-session-poll-parent",
|
|
600
600
|
target,
|
|
601
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
601
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
602
602
|
adapterKey: "acpx",
|
|
603
603
|
command: process.execPath,
|
|
604
604
|
args: [childPath],
|
|
@@ -627,7 +627,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
627
627
|
// With no `getRuntimeParentContext`, the poll tick runs with an empty active
|
|
628
628
|
// step store, exactly like the earlier `runWithoutActiveStep` behavior. So a
|
|
629
629
|
// poll `sandbox.exec` span opens unparented with no stale startup flag.
|
|
630
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
630
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-poll-nogetter-"));
|
|
631
631
|
cleanupDirs.push(rootDir);
|
|
632
632
|
const childPath = path.join(rootDir, "noop-acp-child.mjs");
|
|
633
633
|
await writeFile(childPath, "process.stdin.on('data', () => {});\n", "utf8");
|
|
@@ -658,7 +658,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
658
658
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
659
659
|
runId: "run-process-session-poll-nogetter",
|
|
660
660
|
target,
|
|
661
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
661
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
662
662
|
adapterKey: "acpx",
|
|
663
663
|
command: process.execPath,
|
|
664
664
|
args: [childPath],
|
|
@@ -685,7 +685,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
685
685
|
// message in the `data` handler, not once at connect time. This test opens a
|
|
686
686
|
// socket while `connectParent` is live, switches the getter to `turnParent`,
|
|
687
687
|
// sends one stdin line, and proves the stdin write ran under `turnParent`.
|
|
688
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
688
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-stdin-parent-"));
|
|
689
689
|
cleanupDirs.push(rootDir);
|
|
690
690
|
const childPath = path.join(rootDir, "noop-acp-child.mjs");
|
|
691
691
|
await writeFile(childPath, "process.stdin.on('data', () => {});\n", "utf8");
|
|
@@ -700,11 +700,8 @@ describe("sandbox adapter execution targets", () => {
|
|
|
700
700
|
const delegate = createLocalSandboxRunner();
|
|
701
701
|
const runner = {
|
|
702
702
|
execute: async (input) => {
|
|
703
|
-
// Record the active step for the first exec that writes the stdin file.
|
|
704
|
-
// The `.paperclip-upload` temp path under the `stdin` directory is unique
|
|
705
|
-
// to the stdin-write path; the poll loop reads the `events` directory.
|
|
706
703
|
const script = (input.args ?? []).join("\n");
|
|
707
|
-
if (stdinWriteStep === "unset" && /\/stdin\/[^\s']*
|
|
704
|
+
if (stdinWriteStep === "unset" && /\/stdin\/[^\s']*wardmote-upload/.test(script)) {
|
|
708
705
|
stdinWriteStep = getActiveStepContext();
|
|
709
706
|
resolveStdinWrite();
|
|
710
707
|
}
|
|
@@ -722,7 +719,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
722
719
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
723
720
|
runId: "run-process-session-stdin-parent",
|
|
724
721
|
target,
|
|
725
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
722
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
726
723
|
adapterKey: "acpx",
|
|
727
724
|
command: process.execPath,
|
|
728
725
|
args: [childPath],
|
|
@@ -776,7 +773,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
776
773
|
// message to the agent in a `sandbox.agentSession.sendInput` span. This test
|
|
777
774
|
// connects a socket, sends one stdin line, and proves the handler opens that
|
|
778
775
|
// wrapper span around the write.
|
|
779
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
776
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-sendinput-span-"));
|
|
780
777
|
cleanupDirs.push(rootDir);
|
|
781
778
|
const childPath = path.join(rootDir, "noop-acp-child.mjs");
|
|
782
779
|
await writeFile(childPath, "process.stdin.on('data', () => {});\n", "utf8");
|
|
@@ -796,7 +793,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
796
793
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
797
794
|
runId: "run-process-session-sendinput-span",
|
|
798
795
|
target,
|
|
799
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
796
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
800
797
|
adapterKey: "acpx",
|
|
801
798
|
command: process.execPath,
|
|
802
799
|
args: [childPath],
|
|
@@ -840,7 +837,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
840
837
|
// With a span runner injected, the poll timer wraps each 100 ms poll tick in
|
|
841
838
|
// a `sandbox.agentSession.pollOutput` span. This test lets the first poll tick
|
|
842
839
|
// fire and proves the timer opens that wrapper span.
|
|
843
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
840
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-poll-span-"));
|
|
844
841
|
cleanupDirs.push(rootDir);
|
|
845
842
|
const childPath = path.join(rootDir, "noop-acp-child.mjs");
|
|
846
843
|
await writeFile(childPath, "process.stdin.on('data', () => {});\n", "utf8");
|
|
@@ -860,7 +857,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
860
857
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
861
858
|
runId: "run-process-session-poll-span",
|
|
862
859
|
target,
|
|
863
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
860
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
864
861
|
adapterKey: "acpx",
|
|
865
862
|
command: process.execPath,
|
|
866
863
|
args: [childPath],
|
|
@@ -886,7 +883,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
886
883
|
}
|
|
887
884
|
});
|
|
888
885
|
it("bridges bidirectional sandbox process sessions through a local ACPX-spawnable proxy", async () => {
|
|
889
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
886
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-"));
|
|
890
887
|
cleanupDirs.push(rootDir);
|
|
891
888
|
const childPath = path.join(rootDir, "fake-acp-child.mjs");
|
|
892
889
|
await writeFile(childPath, [
|
|
@@ -906,7 +903,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
906
903
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
907
904
|
runId: "run-process-session",
|
|
908
905
|
target,
|
|
909
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
906
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
910
907
|
adapterKey: "acpx",
|
|
911
908
|
command: process.execPath,
|
|
912
909
|
args: [childPath],
|
|
@@ -918,7 +915,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
918
915
|
expect(bridge).not.toBeNull();
|
|
919
916
|
try {
|
|
920
917
|
const result = await runProxyWithInput(bridge.agentCommand, "hello\n");
|
|
921
|
-
const report = await describeProxyRun(result, path.posix.join(rootDir, ".
|
|
918
|
+
const report = await describeProxyRun(result, path.posix.join(rootDir, ".wardmote-runtime", "acpx"));
|
|
922
919
|
expect(result.code, report).toBe(0);
|
|
923
920
|
expect(result.stdout, report).toBe("out:hello\n");
|
|
924
921
|
expect(result.stderr, report).toBe("err:hello\n");
|
|
@@ -935,7 +932,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
935
932
|
{ streamOutputViaSession: false, exitCode: null },
|
|
936
933
|
{ streamOutputViaSession: true, exitCode: null },
|
|
937
934
|
])("exits with stdin open after remote exit (stream=$streamOutputViaSession, code=$exitCode)", async ({ streamOutputViaSession, exitCode, }) => {
|
|
938
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
935
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-open-stdin-"));
|
|
939
936
|
cleanupDirs.push(rootDir);
|
|
940
937
|
// ACP keeps stdin open while it waits for a handshake. A remote child can
|
|
941
938
|
// exit before replying; that must close the proxy and fail the handshake.
|
|
@@ -950,7 +947,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
950
947
|
remoteCwd: rootDir,
|
|
951
948
|
runner: createLocalSandboxRunner(),
|
|
952
949
|
},
|
|
953
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
950
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
954
951
|
adapterKey: "acpx",
|
|
955
952
|
command: exitCode === null ? path.join(rootDir, "missing-agent") : process.execPath,
|
|
956
953
|
args: ["-e", `process.stdout.write("final output\\n".repeat(16_384)); process.stderr.write("final diagnostic\\n"); process.exitCode = ${exitCode};`],
|
|
@@ -967,7 +964,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
967
964
|
expect(result.code).toBe(exitCode ?? 1);
|
|
968
965
|
const terminal = logs.filter((line) => line.includes("ACP process session terminal:"));
|
|
969
966
|
expect(terminal).toEqual([
|
|
970
|
-
`[
|
|
967
|
+
`[wardmote] ACP process session terminal: source=remote_event outcome=${exitCode === null ? "error" : "exit"} exitCode=${exitCode ?? "unknown"} signal=unknown.\n`,
|
|
971
968
|
]);
|
|
972
969
|
if (exitCode === null) {
|
|
973
970
|
expect(result.stdout).toBe("");
|
|
@@ -983,7 +980,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
983
980
|
}
|
|
984
981
|
}, 15_000);
|
|
985
982
|
it("flushes remote errors under backpressure and retains only bounded terminal evidence", async () => {
|
|
986
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
983
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-terminal-flush-"));
|
|
987
984
|
cleanupDirs.push(rootDir);
|
|
988
985
|
const delegate = createLocalSandboxRunner();
|
|
989
986
|
const logs = [];
|
|
@@ -1057,7 +1054,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1057
1054
|
await closed;
|
|
1058
1055
|
expect(JSON.parse(output)).toEqual(frame);
|
|
1059
1056
|
expect(logs.filter((line) => line.includes("ACP process session terminal:"))).toEqual([
|
|
1060
|
-
"[
|
|
1057
|
+
"[wardmote] ACP process session terminal: source=remote_event outcome=error exitCode=unknown signal=unknown.\n",
|
|
1061
1058
|
]);
|
|
1062
1059
|
}
|
|
1063
1060
|
finally {
|
|
@@ -1068,7 +1065,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1068
1065
|
}
|
|
1069
1066
|
}, 15_000);
|
|
1070
1067
|
it("reports a streamed transport failure even when diagnostic persistence stalls", async () => {
|
|
1071
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1068
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-terminal-stream-"));
|
|
1072
1069
|
cleanupDirs.push(rootDir);
|
|
1073
1070
|
const delegate = createLocalSandboxRunner();
|
|
1074
1071
|
const logs = [];
|
|
@@ -1096,7 +1093,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1096
1093
|
const result = await runProxyWithInput(bridge.agentCommand, "", true);
|
|
1097
1094
|
expect(result.code).toBe(1);
|
|
1098
1095
|
expect(logs).toEqual([
|
|
1099
|
-
"[
|
|
1096
|
+
"[wardmote] ACP process session terminal: source=output_stream outcome=error exitCode=unknown signal=unknown.\n",
|
|
1100
1097
|
]);
|
|
1101
1098
|
}
|
|
1102
1099
|
finally {
|
|
@@ -1105,7 +1102,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1105
1102
|
}
|
|
1106
1103
|
}, 10_000);
|
|
1107
1104
|
it("closes a failed output poll without waiting for the run log", async () => {
|
|
1108
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1105
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-terminal-poll-"));
|
|
1109
1106
|
cleanupDirs.push(rootDir);
|
|
1110
1107
|
const delegate = createLocalSandboxRunner();
|
|
1111
1108
|
const logs = [];
|
|
@@ -1134,7 +1131,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1134
1131
|
const result = await runProxyWithInput(bridge.agentCommand, "", true);
|
|
1135
1132
|
expect(result.code).toBe(1);
|
|
1136
1133
|
expect(logs).toEqual([
|
|
1137
|
-
"[
|
|
1134
|
+
"[wardmote] ACP process session terminal: source=output_poll outcome=error exitCode=unknown signal=unknown.\n",
|
|
1138
1135
|
]);
|
|
1139
1136
|
}
|
|
1140
1137
|
finally {
|
|
@@ -1143,7 +1140,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1143
1140
|
}
|
|
1144
1141
|
}, 10_000);
|
|
1145
1142
|
it("records an unexpected authenticated proxy close once and ignores unauthenticated peers", async () => {
|
|
1146
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1143
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-terminal-proxy-"));
|
|
1147
1144
|
cleanupDirs.push(rootDir);
|
|
1148
1145
|
const logs = [];
|
|
1149
1146
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
@@ -1173,7 +1170,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1173
1170
|
await waitForCondition(() => logs.length === 1, "Missing proxy-close diagnostic.");
|
|
1174
1171
|
await bridge.stop();
|
|
1175
1172
|
expect(logs.filter((line) => line.includes("ACP process session terminal:"))).toEqual([
|
|
1176
|
-
"[
|
|
1173
|
+
"[wardmote] ACP process session terminal: source=proxy_close outcome=error exitCode=unknown signal=unknown.\n",
|
|
1177
1174
|
]);
|
|
1178
1175
|
}
|
|
1179
1176
|
finally {
|
|
@@ -1181,7 +1178,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1181
1178
|
}
|
|
1182
1179
|
}, 10_000);
|
|
1183
1180
|
it("buffers sandbox process session output until the local proxy connects", async () => {
|
|
1184
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1181
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-buffer-"));
|
|
1185
1182
|
cleanupDirs.push(rootDir);
|
|
1186
1183
|
const childPath = path.join(rootDir, "fast-acp-child.mjs");
|
|
1187
1184
|
await writeFile(childPath, [
|
|
@@ -1200,7 +1197,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1200
1197
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
1201
1198
|
runId: "run-process-session-buffer",
|
|
1202
1199
|
target,
|
|
1203
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
1200
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
1204
1201
|
adapterKey: "acpx",
|
|
1205
1202
|
command: process.execPath,
|
|
1206
1203
|
args: [childPath],
|
|
@@ -1222,7 +1219,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1222
1219
|
}
|
|
1223
1220
|
});
|
|
1224
1221
|
it("delivers full output when the sandbox child exits immediately after writing", async () => {
|
|
1225
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1222
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-fast-exit-"));
|
|
1226
1223
|
cleanupDirs.push(rootDir);
|
|
1227
1224
|
const childPath = path.join(rootDir, "instant-exit-acp-child.mjs");
|
|
1228
1225
|
await writeFile(childPath, [
|
|
@@ -1240,7 +1237,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1240
1237
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
1241
1238
|
runId: "run-process-session-fast-exit",
|
|
1242
1239
|
target,
|
|
1243
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
1240
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
1244
1241
|
adapterKey: "acpx",
|
|
1245
1242
|
command: process.execPath,
|
|
1246
1243
|
args: [childPath],
|
|
@@ -1261,7 +1258,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1261
1258
|
}
|
|
1262
1259
|
});
|
|
1263
1260
|
it("ignores unauthenticated connections to the process session bridge", async () => {
|
|
1264
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1261
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-auth-"));
|
|
1265
1262
|
cleanupDirs.push(rootDir);
|
|
1266
1263
|
const childPath = path.join(rootDir, "guarded-acp-child.mjs");
|
|
1267
1264
|
await writeFile(childPath, "process.stdout.write('guarded-out\\n');", "utf8");
|
|
@@ -1276,7 +1273,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1276
1273
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
1277
1274
|
runId: "run-process-session-auth",
|
|
1278
1275
|
target,
|
|
1279
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
1276
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
1280
1277
|
adapterKey: "acpx",
|
|
1281
1278
|
command: process.execPath,
|
|
1282
1279
|
args: [childPath],
|
|
@@ -1322,7 +1319,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1322
1319
|
}
|
|
1323
1320
|
});
|
|
1324
1321
|
it("streams sandbox process session output before the remote child exits", async () => {
|
|
1325
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1322
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-stream-"));
|
|
1326
1323
|
cleanupDirs.push(rootDir);
|
|
1327
1324
|
const childPath = path.join(rootDir, "streaming-acp-child.mjs");
|
|
1328
1325
|
await writeFile(childPath, [
|
|
@@ -1347,7 +1344,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1347
1344
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
1348
1345
|
runId: "run-process-session-stream",
|
|
1349
1346
|
target,
|
|
1350
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
1347
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
1351
1348
|
adapterKey: "acpx",
|
|
1352
1349
|
command: process.execPath,
|
|
1353
1350
|
args: [childPath],
|
|
@@ -1401,7 +1398,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1401
1398
|
});
|
|
1402
1399
|
describe("streamed output (streamOutputViaSession)", () => {
|
|
1403
1400
|
it("bridges bidirectional sessions when the wrapper streams output to stdout", async () => {
|
|
1404
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1401
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-stream-echo-"));
|
|
1405
1402
|
cleanupDirs.push(rootDir);
|
|
1406
1403
|
const childPath = path.join(rootDir, "echo-acp-child.mjs");
|
|
1407
1404
|
await writeFile(childPath, [
|
|
@@ -1421,7 +1418,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1421
1418
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
1422
1419
|
runId: "run-stream-echo",
|
|
1423
1420
|
target,
|
|
1424
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
1421
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
1425
1422
|
adapterKey: "acpx",
|
|
1426
1423
|
command: process.execPath,
|
|
1427
1424
|
args: [childPath],
|
|
@@ -1434,7 +1431,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1434
1431
|
expect(bridge).not.toBeNull();
|
|
1435
1432
|
try {
|
|
1436
1433
|
const result = await runProxyWithInput(bridge.agentCommand, "hello\n");
|
|
1437
|
-
const report = await describeProxyRun(result, path.posix.join(rootDir, ".
|
|
1434
|
+
const report = await describeProxyRun(result, path.posix.join(rootDir, ".wardmote-runtime", "acpx"));
|
|
1438
1435
|
expect(result.code, report).toBe(0);
|
|
1439
1436
|
expect(result.stdout, report).toBe("out:hello\n");
|
|
1440
1437
|
expect(result.stderr, report).toBe("err:hello\n");
|
|
@@ -1449,7 +1446,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1449
1446
|
// step) and stay open around the launch. Record the opened span names and
|
|
1450
1447
|
// prove `sandbox.agentProcess` is among them, and that a normal exchange
|
|
1451
1448
|
// still works through the wrap.
|
|
1452
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1449
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-stream-span-"));
|
|
1453
1450
|
cleanupDirs.push(rootDir);
|
|
1454
1451
|
const childPath = path.join(rootDir, "echo-acp-child.mjs");
|
|
1455
1452
|
await writeFile(childPath, [
|
|
@@ -1469,7 +1466,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1469
1466
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
1470
1467
|
runId: "run-stream-span",
|
|
1471
1468
|
target,
|
|
1472
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
1469
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
1473
1470
|
adapterKey: "acpx",
|
|
1474
1471
|
command: process.execPath,
|
|
1475
1472
|
args: [childPath],
|
|
@@ -1490,7 +1487,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1490
1487
|
// frame flows, so it is observable as soon as the handle resolves.
|
|
1491
1488
|
expect(spanNames).toContain("sandbox.agentProcess");
|
|
1492
1489
|
const result = await runProxyWithInput(bridge.agentCommand, "hello\n");
|
|
1493
|
-
const report = await describeProxyRun(result, path.posix.join(rootDir, ".
|
|
1490
|
+
const report = await describeProxyRun(result, path.posix.join(rootDir, ".wardmote-runtime", "acpx"));
|
|
1494
1491
|
expect(result.code, report).toBe(0);
|
|
1495
1492
|
expect(result.stdout, report).toBe("out:hello\n");
|
|
1496
1493
|
}
|
|
@@ -1504,7 +1501,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1504
1501
|
// `bridge.process-session` bring-up step — otherwise it dangles past its
|
|
1505
1502
|
// parent and overlaps `agent.turn`. Build the real run-rooted runner from a
|
|
1506
1503
|
// recording trace context and assert the recorded parent.
|
|
1507
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1504
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-stream-parent-"));
|
|
1508
1505
|
cleanupDirs.push(rootDir);
|
|
1509
1506
|
const childPath = path.join(rootDir, "noop-acp-child.mjs");
|
|
1510
1507
|
await writeFile(childPath, "process.stdin.on('data', () => {});\n", "utf8");
|
|
@@ -1525,7 +1522,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1525
1522
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
1526
1523
|
runId: "run-stream-parent",
|
|
1527
1524
|
target,
|
|
1528
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
1525
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
1529
1526
|
adapterKey: "acpx",
|
|
1530
1527
|
command: process.execPath,
|
|
1531
1528
|
args: [childPath],
|
|
@@ -1552,7 +1549,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1552
1549
|
// at `stop()`, which the caller awaits before it ends `task.run`. Use a
|
|
1553
1550
|
// child that ignores stdin and never exits on its own, so the launch
|
|
1554
1551
|
// command stays pending across `stop()`, and prove the span ends anyway.
|
|
1555
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1552
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-stream-linger-"));
|
|
1556
1553
|
cleanupDirs.push(rootDir);
|
|
1557
1554
|
const childPath = path.join(rootDir, "linger-acp-child.mjs");
|
|
1558
1555
|
await writeFile(childPath, [
|
|
@@ -1574,7 +1571,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1574
1571
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
1575
1572
|
runId: "run-stream-linger",
|
|
1576
1573
|
target,
|
|
1577
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
1574
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
1578
1575
|
adapterKey: "acpx",
|
|
1579
1576
|
command: process.execPath,
|
|
1580
1577
|
args: [childPath],
|
|
@@ -1606,7 +1603,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1606
1603
|
expect(record.ended).toBe(true);
|
|
1607
1604
|
});
|
|
1608
1605
|
it("buffers streamed output until the local proxy connects", async () => {
|
|
1609
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1606
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-stream-buffer-"));
|
|
1610
1607
|
cleanupDirs.push(rootDir);
|
|
1611
1608
|
const childPath = path.join(rootDir, "fast-stream-child.mjs");
|
|
1612
1609
|
await writeFile(childPath, [
|
|
@@ -1625,7 +1622,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1625
1622
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
1626
1623
|
runId: "run-stream-buffer",
|
|
1627
1624
|
target,
|
|
1628
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
1625
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
1629
1626
|
adapterKey: "acpx",
|
|
1630
1627
|
command: process.execPath,
|
|
1631
1628
|
args: [childPath],
|
|
@@ -1650,7 +1647,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1650
1647
|
}
|
|
1651
1648
|
});
|
|
1652
1649
|
it("delivers full streamed output when the sandbox child exits immediately", async () => {
|
|
1653
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1650
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-stream-fast-exit-"));
|
|
1654
1651
|
cleanupDirs.push(rootDir);
|
|
1655
1652
|
const childPath = path.join(rootDir, "instant-stream-child.mjs");
|
|
1656
1653
|
await writeFile(childPath, [
|
|
@@ -1668,7 +1665,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1668
1665
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
1669
1666
|
runId: "run-stream-fast-exit",
|
|
1670
1667
|
target,
|
|
1671
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
1668
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
1672
1669
|
adapterKey: "acpx",
|
|
1673
1670
|
command: process.execPath,
|
|
1674
1671
|
args: [childPath],
|
|
@@ -1690,7 +1687,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1690
1687
|
}
|
|
1691
1688
|
});
|
|
1692
1689
|
it("streams live output before the child exits and never writes output event files", async () => {
|
|
1693
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1690
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-stream-live-"));
|
|
1694
1691
|
cleanupDirs.push(rootDir);
|
|
1695
1692
|
const childPath = path.join(rootDir, "live-stream-child.mjs");
|
|
1696
1693
|
await writeFile(childPath, [
|
|
@@ -1715,7 +1712,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1715
1712
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
1716
1713
|
runId: "run-stream-live",
|
|
1717
1714
|
target,
|
|
1718
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
1715
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
1719
1716
|
adapterKey: "acpx",
|
|
1720
1717
|
command: process.execPath,
|
|
1721
1718
|
args: [childPath],
|
|
@@ -1761,7 +1758,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1761
1758
|
await expect(exitPromise).resolves.toBe(0);
|
|
1762
1759
|
// The streamed path uses the stdout wrapper, not the output-file poll, so
|
|
1763
1760
|
// no `events` directory is ever created under the session runtime tree.
|
|
1764
|
-
const hasEventsDir = await readdir(path.posix.join(rootDir, ".
|
|
1761
|
+
const hasEventsDir = await readdir(path.posix.join(rootDir, ".wardmote-runtime", "acpx", "process-sessions"), { withFileTypes: true, recursive: true })
|
|
1765
1762
|
.then((entries) => entries.some((entry) => entry.isDirectory() && entry.name === "events"))
|
|
1766
1763
|
.catch(() => false);
|
|
1767
1764
|
expect(hasEventsDir).toBe(false);
|
|
@@ -1782,7 +1779,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1782
1779
|
// teardown) must run concurrently with the agent, so each must force
|
|
1783
1780
|
// itself off the session. On the session they queue behind the agent
|
|
1784
1781
|
// command that never returns, and the first handshake write never drains.
|
|
1785
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
1782
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-process-session-stream-isolation-"));
|
|
1786
1783
|
cleanupDirs.push(rootDir);
|
|
1787
1784
|
const childPath = path.join(rootDir, "echo-acp-child.mjs");
|
|
1788
1785
|
await writeFile(childPath, [
|
|
@@ -1814,7 +1811,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1814
1811
|
const bridge = await startAdapterExecutionTargetProcessSessionBridge({
|
|
1815
1812
|
runId: "run-stream-isolation",
|
|
1816
1813
|
target,
|
|
1817
|
-
runtimeRootDir: path.posix.join(rootDir, ".
|
|
1814
|
+
runtimeRootDir: path.posix.join(rootDir, ".wardmote-runtime", "acpx"),
|
|
1818
1815
|
adapterKey: "acpx",
|
|
1819
1816
|
command: process.execPath,
|
|
1820
1817
|
args: [childPath],
|
|
@@ -1829,7 +1826,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
1829
1826
|
// Round-trip one input so a stdin-delivery control exec runs and gets
|
|
1830
1827
|
// recorded before the assertions below.
|
|
1831
1828
|
const result = await runProxyWithInput(bridge.agentCommand, "hello\n");
|
|
1832
|
-
expect(result.stdout, await describeProxyRun(result, path.posix.join(rootDir, ".
|
|
1829
|
+
expect(result.stdout, await describeProxyRun(result, path.posix.join(rootDir, ".wardmote-runtime", "acpx"))).toBe("out:hello\n");
|
|
1833
1830
|
// Exactly one exec runs on the persistent session: the long-lived agent
|
|
1834
1831
|
// command. It streams its output through the session log stream, so it
|
|
1835
1832
|
// must not also bypass the session.
|
|
@@ -2171,7 +2168,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2171
2168
|
strictHostKeyChecking: true,
|
|
2172
2169
|
},
|
|
2173
2170
|
};
|
|
2174
|
-
expect(
|
|
2171
|
+
expect(adapterExecutionTargetUsesWardmoteBridge(target)).toBe(true);
|
|
2175
2172
|
expect(adapterExecutionTargetSessionIdentity(target)).toEqual({
|
|
2176
2173
|
transport: "ssh",
|
|
2177
2174
|
host: "ssh.example.test",
|
|
@@ -2212,11 +2209,11 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2212
2209
|
timeoutMs: 7000,
|
|
2213
2210
|
}));
|
|
2214
2211
|
});
|
|
2215
|
-
it("starts a localhost
|
|
2216
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
2212
|
+
it("starts a localhost Wardmote bridge for sandbox targets in bridge mode", async () => {
|
|
2213
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-execution-target-bridge-"));
|
|
2217
2214
|
cleanupDirs.push(rootDir);
|
|
2218
2215
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
2219
|
-
const runtimeRootDir = path.join(remoteCwd, ".
|
|
2216
|
+
const runtimeRootDir = path.join(remoteCwd, ".wardmote-runtime", "codex");
|
|
2220
2217
|
await mkdir(runtimeRootDir, { recursive: true });
|
|
2221
2218
|
const requests = [];
|
|
2222
2219
|
const apiServer = createServer((req, res) => {
|
|
@@ -2224,7 +2221,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2224
2221
|
method: req.method ?? "GET",
|
|
2225
2222
|
url: req.url ?? "/",
|
|
2226
2223
|
auth: req.headers.authorization ?? null,
|
|
2227
|
-
runId: typeof req.headers["x-
|
|
2224
|
+
runId: typeof req.headers["x-wardmote-run-id"] === "string" ? req.headers["x-wardmote-run-id"] : null,
|
|
2228
2225
|
});
|
|
2229
2226
|
res.writeHead(200, { "content-type": "application/json" });
|
|
2230
2227
|
res.end(JSON.stringify({ ok: true }));
|
|
@@ -2247,7 +2244,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2247
2244
|
runner: createLocalSandboxRunner(),
|
|
2248
2245
|
timeoutMs: 30_000,
|
|
2249
2246
|
};
|
|
2250
|
-
const bridge = await
|
|
2247
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
2251
2248
|
runId: "run-bridge",
|
|
2252
2249
|
target,
|
|
2253
2250
|
runtimeRootDir,
|
|
@@ -2281,10 +2278,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2281
2278
|
}
|
|
2282
2279
|
});
|
|
2283
2280
|
it("creates a sandbox run log tail factory when bridge streaming is enabled", async () => {
|
|
2284
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
2281
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-execution-target-bridge-stream-"));
|
|
2285
2282
|
cleanupDirs.push(rootDir);
|
|
2286
2283
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
2287
|
-
const runtimeRootDir = path.join(remoteCwd, ".
|
|
2284
|
+
const runtimeRootDir = path.join(remoteCwd, ".wardmote-runtime", "codex");
|
|
2288
2285
|
await mkdir(runtimeRootDir, { recursive: true });
|
|
2289
2286
|
const logs = [];
|
|
2290
2287
|
const target = {
|
|
@@ -2298,7 +2295,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2298
2295
|
streamRunLogs: true,
|
|
2299
2296
|
timeoutMs: 30_000,
|
|
2300
2297
|
};
|
|
2301
|
-
const bridge = await
|
|
2298
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
2302
2299
|
runId: "run-bridge-stream",
|
|
2303
2300
|
target,
|
|
2304
2301
|
runtimeRootDir,
|
|
@@ -2322,10 +2319,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2322
2319
|
}
|
|
2323
2320
|
});
|
|
2324
2321
|
it("defaults sandbox run log streaming on and honors the explicit opt-out", async () => {
|
|
2325
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
2322
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-execution-target-bridge-stream-default-"));
|
|
2326
2323
|
cleanupDirs.push(rootDir);
|
|
2327
2324
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
2328
|
-
const runtimeRootDir = path.join(remoteCwd, ".
|
|
2325
|
+
const runtimeRootDir = path.join(remoteCwd, ".wardmote-runtime", "codex");
|
|
2329
2326
|
await mkdir(runtimeRootDir, { recursive: true });
|
|
2330
2327
|
const baseTarget = {
|
|
2331
2328
|
kind: "remote",
|
|
@@ -2337,7 +2334,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2337
2334
|
runner: createLocalSandboxRunner(),
|
|
2338
2335
|
timeoutMs: 30_000,
|
|
2339
2336
|
};
|
|
2340
|
-
const defaultBridge = await
|
|
2337
|
+
const defaultBridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
2341
2338
|
runId: "run-bridge-stream-default",
|
|
2342
2339
|
target: baseTarget,
|
|
2343
2340
|
runtimeRootDir,
|
|
@@ -2351,7 +2348,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2351
2348
|
finally {
|
|
2352
2349
|
await defaultBridge?.stop();
|
|
2353
2350
|
}
|
|
2354
|
-
const optOutBridge = await
|
|
2351
|
+
const optOutBridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
2355
2352
|
runId: "run-bridge-stream-opt-out",
|
|
2356
2353
|
target: { ...baseTarget, streamRunLogs: false },
|
|
2357
2354
|
runtimeRootDir,
|
|
@@ -2396,7 +2393,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2396
2393
|
const tail = createSandboxRunLogTailFactory({
|
|
2397
2394
|
runner,
|
|
2398
2395
|
remoteCwd: "/workspace",
|
|
2399
|
-
logsDir: "/workspace/.
|
|
2396
|
+
logsDir: "/workspace/.wardmote-runtime/codex/wardmote-bridge/queue/logs",
|
|
2400
2397
|
pollIntervalMs: 1,
|
|
2401
2398
|
maxChunkBytesPerTick: 4,
|
|
2402
2399
|
tickTimeoutMs: 50,
|
|
@@ -2440,7 +2437,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2440
2437
|
const tail = createSandboxRunLogTailFactory({
|
|
2441
2438
|
runner,
|
|
2442
2439
|
remoteCwd: "/workspace",
|
|
2443
|
-
logsDir: "/workspace/.
|
|
2440
|
+
logsDir: "/workspace/.wardmote-runtime/codex/wardmote-bridge/queue/logs",
|
|
2444
2441
|
pollIntervalMs: 1,
|
|
2445
2442
|
maxChunkBytesPerTick: 7,
|
|
2446
2443
|
tickTimeoutMs: 50,
|
|
@@ -2470,7 +2467,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2470
2467
|
const tail = createSandboxRunLogTailFactory({
|
|
2471
2468
|
runner,
|
|
2472
2469
|
remoteCwd: "/workspace",
|
|
2473
|
-
logsDir: "/workspace/.
|
|
2470
|
+
logsDir: "/workspace/.wardmote-runtime/codex/wardmote-bridge/queue/logs",
|
|
2474
2471
|
pollIntervalMs: 1,
|
|
2475
2472
|
tickTimeoutMs: 50,
|
|
2476
2473
|
maxConsecutiveFailures: 1,
|
|
@@ -2482,13 +2479,13 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2482
2479
|
await new Promise((resolve) => setTimeout(resolve, 5));
|
|
2483
2480
|
await tail.finish({ stdout: "final out\n", stderr: "final err\n" });
|
|
2484
2481
|
expect(combinedStream(events, "stdout")).toBe("final out\n");
|
|
2485
|
-
expect(combinedStream(events, "stderr")).toBe("final err\n[
|
|
2482
|
+
expect(combinedStream(events, "stderr")).toBe("final err\n[wardmote] Run log streaming degraded during the run; remaining output was delivered at completion.\n");
|
|
2486
2483
|
});
|
|
2487
|
-
it("exposes the
|
|
2488
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
2484
|
+
it("exposes the Wardmote bridge to the sandbox shell surface", async () => {
|
|
2485
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-execution-target-bridge-shell-"));
|
|
2489
2486
|
cleanupDirs.push(rootDir);
|
|
2490
2487
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
2491
|
-
const runtimeRootDir = path.join(remoteCwd, ".
|
|
2488
|
+
const runtimeRootDir = path.join(remoteCwd, ".wardmote-runtime", "claude");
|
|
2492
2489
|
await mkdir(runtimeRootDir, { recursive: true });
|
|
2493
2490
|
const requests = [];
|
|
2494
2491
|
const apiServer = createServer((req, res) => {
|
|
@@ -2496,7 +2493,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2496
2493
|
method: req.method ?? "GET",
|
|
2497
2494
|
url: req.url ?? "/",
|
|
2498
2495
|
auth: req.headers.authorization ?? null,
|
|
2499
|
-
runId: typeof req.headers["x-
|
|
2496
|
+
runId: typeof req.headers["x-wardmote-run-id"] === "string" ? req.headers["x-wardmote-run-id"] : null,
|
|
2500
2497
|
});
|
|
2501
2498
|
res.writeHead(200, { "content-type": "application/json" });
|
|
2502
2499
|
res.end(JSON.stringify({ ok: true }));
|
|
@@ -2523,7 +2520,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2523
2520
|
runner,
|
|
2524
2521
|
timeoutMs: 30_000,
|
|
2525
2522
|
};
|
|
2526
|
-
const bridge = await
|
|
2523
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
2527
2524
|
runId: "run-bridge-shell",
|
|
2528
2525
|
target,
|
|
2529
2526
|
runtimeRootDir,
|
|
@@ -2587,10 +2584,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2587
2584
|
}
|
|
2588
2585
|
});
|
|
2589
2586
|
it("bounds callback bridge operations independently of the adapter run timeout", async () => {
|
|
2590
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
2587
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-execution-target-bridge-timeout-"));
|
|
2591
2588
|
cleanupDirs.push(rootDir);
|
|
2592
2589
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
2593
|
-
const runtimeRootDir = path.join(remoteCwd, ".
|
|
2590
|
+
const runtimeRootDir = path.join(remoteCwd, ".wardmote-runtime", "codex");
|
|
2594
2591
|
await mkdir(runtimeRootDir, { recursive: true });
|
|
2595
2592
|
const delegateRunner = createLocalSandboxRunner();
|
|
2596
2593
|
const runner = {
|
|
@@ -2618,7 +2615,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2618
2615
|
runner,
|
|
2619
2616
|
timeoutMs: 30_000,
|
|
2620
2617
|
};
|
|
2621
|
-
const bridge = await
|
|
2618
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
2622
2619
|
runId: "run-bridge-timeout",
|
|
2623
2620
|
target,
|
|
2624
2621
|
runtimeRootDir,
|
|
@@ -2648,10 +2645,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2648
2645
|
// a retryable 502. The in-sandbox server maps the indeterminate 504 to a
|
|
2649
2646
|
// non-retryable 409. A retryable status would repeat the mutation with a new
|
|
2650
2647
|
// request id outside the broker deduplication set.
|
|
2651
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
2648
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-execution-target-bridge-limit-"));
|
|
2652
2649
|
cleanupDirs.push(rootDir);
|
|
2653
2650
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
2654
|
-
const runtimeRootDir = path.join(remoteCwd, ".
|
|
2651
|
+
const runtimeRootDir = path.join(remoteCwd, ".wardmote-runtime", "codex");
|
|
2655
2652
|
await mkdir(runtimeRootDir, { recursive: true });
|
|
2656
2653
|
const requests = [];
|
|
2657
2654
|
// The host body sits over the size limit, so the forward read fails. The
|
|
@@ -2663,7 +2660,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2663
2660
|
method: req.method ?? "GET",
|
|
2664
2661
|
url: req.url ?? "/",
|
|
2665
2662
|
auth: req.headers.authorization ?? null,
|
|
2666
|
-
runId: typeof req.headers["x-
|
|
2663
|
+
runId: typeof req.headers["x-wardmote-run-id"] === "string" ? req.headers["x-wardmote-run-id"] : null,
|
|
2667
2664
|
});
|
|
2668
2665
|
res.writeHead(201, {
|
|
2669
2666
|
"content-type": "application/json",
|
|
@@ -2689,7 +2686,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2689
2686
|
runner: createLocalSandboxRunner(),
|
|
2690
2687
|
timeoutMs: 30_000,
|
|
2691
2688
|
};
|
|
2692
|
-
const bridge = await
|
|
2689
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
2693
2690
|
runId: "run-bridge-limit",
|
|
2694
2691
|
target,
|
|
2695
2692
|
runtimeRootDir,
|
|
@@ -2710,7 +2707,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2710
2707
|
// The indeterminate 504 maps to a non-retryable 409, so the caller does not
|
|
2711
2708
|
// retry the committed mutation.
|
|
2712
2709
|
expect(response.status).toBe(409);
|
|
2713
|
-
expect(response.headers.get("x-
|
|
2710
|
+
expect(response.headers.get("x-wardmote-bridge-outcome")).toBe("indeterminate");
|
|
2714
2711
|
await expect(response.json()).resolves.toEqual({
|
|
2715
2712
|
error: "Bridge response body exceeded the configured size limit of 512 bytes.",
|
|
2716
2713
|
outcome: "indeterminate",
|
|
@@ -2736,10 +2733,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2736
2733
|
// retryable 502 with no indeterminate marker, not the non-retryable 504 the
|
|
2737
2734
|
// forward returns for a mutating method. The in-sandbox server passes the 502
|
|
2738
2735
|
// through, so the caller can retry the safe read.
|
|
2739
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
2736
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-execution-target-bridge-safe-limit-"));
|
|
2740
2737
|
cleanupDirs.push(rootDir);
|
|
2741
2738
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
2742
|
-
const runtimeRootDir = path.join(remoteCwd, ".
|
|
2739
|
+
const runtimeRootDir = path.join(remoteCwd, ".wardmote-runtime", "codex");
|
|
2743
2740
|
await mkdir(runtimeRootDir, { recursive: true });
|
|
2744
2741
|
const requests = [];
|
|
2745
2742
|
const largeBody = "x".repeat(1024);
|
|
@@ -2748,7 +2745,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2748
2745
|
method: req.method ?? "GET",
|
|
2749
2746
|
url: req.url ?? "/",
|
|
2750
2747
|
auth: req.headers.authorization ?? null,
|
|
2751
|
-
runId: typeof req.headers["x-
|
|
2748
|
+
runId: typeof req.headers["x-wardmote-run-id"] === "string" ? req.headers["x-wardmote-run-id"] : null,
|
|
2752
2749
|
});
|
|
2753
2750
|
res.writeHead(200, {
|
|
2754
2751
|
"content-type": "application/json",
|
|
@@ -2774,7 +2771,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2774
2771
|
runner: createLocalSandboxRunner(),
|
|
2775
2772
|
timeoutMs: 30_000,
|
|
2776
2773
|
};
|
|
2777
|
-
const bridge = await
|
|
2774
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
2778
2775
|
runId: "run-bridge-safe-limit",
|
|
2779
2776
|
target,
|
|
2780
2777
|
runtimeRootDir,
|
|
@@ -2793,7 +2790,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2793
2790
|
// The forward returns a retryable 502 with no indeterminate marker, so the
|
|
2794
2791
|
// server passes it through instead of mapping it to a terminal 409.
|
|
2795
2792
|
expect(response.status).toBe(502);
|
|
2796
|
-
expect(response.headers.get("x-
|
|
2793
|
+
expect(response.headers.get("x-wardmote-bridge-outcome")).toBeNull();
|
|
2797
2794
|
await expect(response.json()).resolves.toEqual({
|
|
2798
2795
|
error: "Bridge response body exceeded the configured size limit of 512 bytes.",
|
|
2799
2796
|
});
|
|
@@ -2810,21 +2807,16 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2810
2807
|
}
|
|
2811
2808
|
});
|
|
2812
2809
|
it("forwards the host indeterminate-outcome header so the sandbox server maps the 504 to a non-retryable 409", async () => {
|
|
2813
|
-
|
|
2814
|
-
// `x-paperclip-bridge-outcome: indeterminate` header. The forward must keep
|
|
2815
|
-
// that header, so the in-sandbox server maps the 504 to a non-retryable 409.
|
|
2816
|
-
// If the forward drops the header, the client sees a retryable 504 and a
|
|
2817
|
-
// retry repeats a mutation that already committed.
|
|
2818
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-execution-target-bridge-outcome-"));
|
|
2810
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-execution-target-bridge-outcome-"));
|
|
2819
2811
|
cleanupDirs.push(rootDir);
|
|
2820
2812
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
2821
|
-
const runtimeRootDir = path.join(remoteCwd, ".
|
|
2813
|
+
const runtimeRootDir = path.join(remoteCwd, ".wardmote-runtime", "codex");
|
|
2822
2814
|
await mkdir(runtimeRootDir, { recursive: true });
|
|
2823
2815
|
const responseBody = JSON.stringify({ error: "Mutation outcome is indeterminate.", outcome: "indeterminate", retryable: false });
|
|
2824
2816
|
const apiServer = createServer((_req, res) => {
|
|
2825
2817
|
res.writeHead(504, {
|
|
2826
2818
|
"content-type": "application/json",
|
|
2827
|
-
"x-
|
|
2819
|
+
"x-wardmote-bridge-outcome": "indeterminate",
|
|
2828
2820
|
});
|
|
2829
2821
|
res.end(responseBody);
|
|
2830
2822
|
});
|
|
@@ -2846,7 +2838,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2846
2838
|
runner: createLocalSandboxRunner(),
|
|
2847
2839
|
timeoutMs: 30_000,
|
|
2848
2840
|
};
|
|
2849
|
-
const bridge = await
|
|
2841
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
2850
2842
|
runId: "run-bridge-outcome",
|
|
2851
2843
|
target,
|
|
2852
2844
|
runtimeRootDir,
|
|
@@ -2867,7 +2859,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2867
2859
|
expect(response.status).toBe(409);
|
|
2868
2860
|
// The outcome header and body still reach the client, so a caller that
|
|
2869
2861
|
// reads them still sees the indeterminate result.
|
|
2870
|
-
expect(response.headers.get("x-
|
|
2862
|
+
expect(response.headers.get("x-wardmote-bridge-outcome")).toBe("indeterminate");
|
|
2871
2863
|
await expect(response.json()).resolves.toEqual({
|
|
2872
2864
|
error: "Mutation outcome is indeterminate.",
|
|
2873
2865
|
outcome: "indeterminate",
|
|
@@ -2880,10 +2872,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2880
2872
|
}
|
|
2881
2873
|
});
|
|
2882
2874
|
it("forwards bridge traffic to the local listen origin even when public API URLs are configured", async () => {
|
|
2883
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
2875
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-execution-target-bridge-local-"));
|
|
2884
2876
|
cleanupDirs.push(rootDir);
|
|
2885
2877
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
2886
|
-
const runtimeRootDir = path.join(remoteCwd, ".
|
|
2878
|
+
const runtimeRootDir = path.join(remoteCwd, ".wardmote-runtime", "claude");
|
|
2887
2879
|
await mkdir(runtimeRootDir, { recursive: true });
|
|
2888
2880
|
const requests = [];
|
|
2889
2881
|
const apiServer = createServer((req, res) => {
|
|
@@ -2891,7 +2883,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2891
2883
|
method: req.method ?? "GET",
|
|
2892
2884
|
url: req.url ?? "/",
|
|
2893
2885
|
auth: req.headers.authorization ?? null,
|
|
2894
|
-
runId: typeof req.headers["x-
|
|
2886
|
+
runId: typeof req.headers["x-wardmote-run-id"] === "string" ? req.headers["x-wardmote-run-id"] : null,
|
|
2895
2887
|
});
|
|
2896
2888
|
res.writeHead(200, { "content-type": "application/json" });
|
|
2897
2889
|
res.end(JSON.stringify({ ok: true }));
|
|
@@ -2923,7 +2915,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2923
2915
|
runner: createLocalSandboxRunner(),
|
|
2924
2916
|
timeoutMs: 30_000,
|
|
2925
2917
|
};
|
|
2926
|
-
const bridge = await
|
|
2918
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
2927
2919
|
runId: "run-bridge-local",
|
|
2928
2920
|
target,
|
|
2929
2921
|
runtimeRootDir,
|
|
@@ -2953,10 +2945,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2953
2945
|
}
|
|
2954
2946
|
});
|
|
2955
2947
|
it("lets an explicit hostApiUrl input override the bridge forward target", async () => {
|
|
2956
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
2948
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-execution-target-bridge-override-"));
|
|
2957
2949
|
cleanupDirs.push(rootDir);
|
|
2958
2950
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
2959
|
-
const runtimeRootDir = path.join(remoteCwd, ".
|
|
2951
|
+
const runtimeRootDir = path.join(remoteCwd, ".wardmote-runtime", "claude");
|
|
2960
2952
|
await mkdir(runtimeRootDir, { recursive: true });
|
|
2961
2953
|
const requests = [];
|
|
2962
2954
|
const apiServer = createServer((req, res) => {
|
|
@@ -2988,7 +2980,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
2988
2980
|
runner: createLocalSandboxRunner(),
|
|
2989
2981
|
timeoutMs: 30_000,
|
|
2990
2982
|
};
|
|
2991
|
-
const bridge = await
|
|
2983
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
2992
2984
|
runId: "run-bridge-override",
|
|
2993
2985
|
target,
|
|
2994
2986
|
runtimeRootDir,
|
|
@@ -3197,7 +3189,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3197
3189
|
// Build a minimal multipart/form-data request body with one binary file
|
|
3198
3190
|
// part, plus the matching `content-type` header value.
|
|
3199
3191
|
function buildMultipartAttachmentUpload(fileBytes) {
|
|
3200
|
-
const boundary = "
|
|
3192
|
+
const boundary = "wardmote-test-boundary";
|
|
3201
3193
|
const head = Buffer.from(`--${boundary}\r\n` +
|
|
3202
3194
|
`Content-Disposition: form-data; name="file"; filename="upload.bin"\r\n` +
|
|
3203
3195
|
`Content-Type: application/octet-stream\r\n\r\n`, "utf8");
|
|
@@ -3225,7 +3217,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3225
3217
|
method: req.method ?? "GET",
|
|
3226
3218
|
url: req.url ?? "/",
|
|
3227
3219
|
auth: req.headers.authorization ?? null,
|
|
3228
|
-
runId: typeof req.headers["x-
|
|
3220
|
+
runId: typeof req.headers["x-wardmote-run-id"] === "string" ? req.headers["x-wardmote-run-id"] : null,
|
|
3229
3221
|
headers,
|
|
3230
3222
|
body: Buffer.concat(chunks),
|
|
3231
3223
|
});
|
|
@@ -3259,7 +3251,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3259
3251
|
// The channel open itself fails (a provider startup fault, before any
|
|
3260
3252
|
// READY line or preface is possible). The host must fall back to the
|
|
3261
3253
|
// file bridge and record the typed open-failure reason, never hang.
|
|
3262
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
3254
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-startup-fail-"));
|
|
3263
3255
|
cleanupDirs.push(rootDir);
|
|
3264
3256
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
3265
3257
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -3281,10 +3273,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3281
3273
|
runner,
|
|
3282
3274
|
effectiveCapabilities: duplexCapabilities(true),
|
|
3283
3275
|
};
|
|
3284
|
-
const bridge = await
|
|
3276
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
3285
3277
|
runId: "run-startup-fail",
|
|
3286
3278
|
target,
|
|
3287
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
3279
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
3288
3280
|
adapterKey: "codex",
|
|
3289
3281
|
hostApiToken: "real-run-jwt",
|
|
3290
3282
|
hostApiUrl: api.origin,
|
|
@@ -3317,7 +3309,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3317
3309
|
}
|
|
3318
3310
|
}, 20000);
|
|
3319
3311
|
it("test_daytona_selects_http2_v1", async () => {
|
|
3320
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
3312
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-select-"));
|
|
3321
3313
|
cleanupDirs.push(rootDir);
|
|
3322
3314
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
3323
3315
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -3340,10 +3332,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3340
3332
|
runner,
|
|
3341
3333
|
effectiveCapabilities: duplexCapabilities(true),
|
|
3342
3334
|
};
|
|
3343
|
-
const bridge = await
|
|
3335
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
3344
3336
|
runId: "run-http2",
|
|
3345
3337
|
target,
|
|
3346
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
3338
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
3347
3339
|
adapterKey: "codex",
|
|
3348
3340
|
hostApiToken: "real-run-jwt",
|
|
3349
3341
|
hostApiUrl: api.origin,
|
|
@@ -3384,7 +3376,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3384
3376
|
expect(control.stopCount).toBeGreaterThanOrEqual(1);
|
|
3385
3377
|
}, 20000);
|
|
3386
3378
|
it("streams run logs on the http2 path under the same gate and log line as the file path", async () => {
|
|
3387
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
3379
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-runlog-"));
|
|
3388
3380
|
cleanupDirs.push(rootDir);
|
|
3389
3381
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
3390
3382
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -3401,10 +3393,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3401
3393
|
streamRunLogs: true,
|
|
3402
3394
|
effectiveCapabilities: duplexCapabilities(true),
|
|
3403
3395
|
};
|
|
3404
|
-
const bridge = await
|
|
3396
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
3405
3397
|
runId: "run-duplex-log",
|
|
3406
3398
|
target,
|
|
3407
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
3399
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
3408
3400
|
adapterKey: "codex",
|
|
3409
3401
|
hostApiToken: "real-run-jwt",
|
|
3410
3402
|
hostApiUrl: api.origin,
|
|
@@ -3429,7 +3421,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3429
3421
|
}
|
|
3430
3422
|
}, 20000);
|
|
3431
3423
|
it("returns no run-log tail on the http2 path when streaming is opted out", async () => {
|
|
3432
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
3424
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-runlog-off-"));
|
|
3433
3425
|
cleanupDirs.push(rootDir);
|
|
3434
3426
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
3435
3427
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -3445,10 +3437,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3445
3437
|
streamRunLogs: false,
|
|
3446
3438
|
effectiveCapabilities: duplexCapabilities(true),
|
|
3447
3439
|
};
|
|
3448
|
-
const bridge = await
|
|
3440
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
3449
3441
|
runId: "run-http2-log-off",
|
|
3450
3442
|
target,
|
|
3451
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
3443
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
3452
3444
|
adapterKey: "codex",
|
|
3453
3445
|
hostApiToken: "real-run-jwt",
|
|
3454
3446
|
hostApiUrl: api.origin,
|
|
@@ -3464,7 +3456,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3464
3456
|
}
|
|
3465
3457
|
}, 20000);
|
|
3466
3458
|
it("routes http2 channel-open and fallback records to a recorder attached on the server seam", async () => {
|
|
3467
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
3459
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-recorder-"));
|
|
3468
3460
|
cleanupDirs.push(rootDir);
|
|
3469
3461
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
3470
3462
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -3490,10 +3482,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3490
3482
|
effectiveCapabilities: duplexCapabilities(true),
|
|
3491
3483
|
duplexObservabilityRecorder: recorder,
|
|
3492
3484
|
};
|
|
3493
|
-
const openBridge = await
|
|
3485
|
+
const openBridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
3494
3486
|
runId: "run-http2-open",
|
|
3495
3487
|
target: openTarget,
|
|
3496
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
3488
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
3497
3489
|
adapterKey: "codex",
|
|
3498
3490
|
hostApiToken: "real-run-jwt",
|
|
3499
3491
|
hostApiUrl: api.origin,
|
|
@@ -3522,10 +3514,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3522
3514
|
effectiveCapabilities: duplexCapabilities(true),
|
|
3523
3515
|
duplexObservabilityRecorder: recorder,
|
|
3524
3516
|
};
|
|
3525
|
-
const fallbackBridge = await
|
|
3517
|
+
const fallbackBridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
3526
3518
|
runId: "run-duplex-fallback",
|
|
3527
3519
|
target: fallbackTarget,
|
|
3528
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
3520
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
3529
3521
|
adapterKey: "codex",
|
|
3530
3522
|
hostApiToken: "real-run-jwt",
|
|
3531
3523
|
hostApiUrl: api.origin,
|
|
@@ -3547,7 +3539,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3547
3539
|
{ name: "the kill switch is off with the capability granted", enable: false, capability: true },
|
|
3548
3540
|
{ name: "the capability is absent with the kill switch on", enable: true, capability: false },
|
|
3549
3541
|
])("selects the file bridge when $name", async ({ enable, capability }) => {
|
|
3550
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
3542
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-gate-"));
|
|
3551
3543
|
cleanupDirs.push(rootDir);
|
|
3552
3544
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
3553
3545
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -3562,10 +3554,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3562
3554
|
runner,
|
|
3563
3555
|
effectiveCapabilities: duplexCapabilities(capability),
|
|
3564
3556
|
};
|
|
3565
|
-
const bridge = await
|
|
3557
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
3566
3558
|
runId: "run-gate",
|
|
3567
3559
|
target,
|
|
3568
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
3560
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
3569
3561
|
adapterKey: "codex",
|
|
3570
3562
|
hostApiToken: "real-run-jwt",
|
|
3571
3563
|
hostApiUrl: api.origin,
|
|
@@ -3604,7 +3596,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3604
3596
|
onOpen: () => { },
|
|
3605
3597
|
},
|
|
3606
3598
|
])("fails closed to the file bridge on $name and leaves no live session", async ({ onOpen }) => {
|
|
3607
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
3599
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-fail-"));
|
|
3608
3600
|
cleanupDirs.push(rootDir);
|
|
3609
3601
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
3610
3602
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -3619,10 +3611,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3619
3611
|
runner,
|
|
3620
3612
|
effectiveCapabilities: duplexCapabilities(true),
|
|
3621
3613
|
};
|
|
3622
|
-
const bridge = await
|
|
3614
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
3623
3615
|
runId: "run-fail",
|
|
3624
3616
|
target,
|
|
3625
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
3617
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
3626
3618
|
adapterKey: "codex",
|
|
3627
3619
|
hostApiToken: "real-run-jwt",
|
|
3628
3620
|
hostApiUrl: api.origin,
|
|
@@ -3652,7 +3644,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3652
3644
|
buildReady: (nonce, attackerPort) => `{"version":2,"type":"ready","nonce":"${nonce}","address":"http://127.0.0.1:${attackerPort}"}\n`,
|
|
3653
3645
|
},
|
|
3654
3646
|
])("rejects a READY frame that carries $name and never sends the bridge token there", async ({ buildReady }) => {
|
|
3655
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
3647
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-addr-"));
|
|
3656
3648
|
cleanupDirs.push(rootDir);
|
|
3657
3649
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
3658
3650
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -3685,10 +3677,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3685
3677
|
runner,
|
|
3686
3678
|
effectiveCapabilities: duplexCapabilities(true),
|
|
3687
3679
|
};
|
|
3688
|
-
const bridge = await
|
|
3680
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
3689
3681
|
runId: "run-addr",
|
|
3690
3682
|
target,
|
|
3691
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
3683
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
3692
3684
|
adapterKey: "codex",
|
|
3693
3685
|
hostApiToken: "real-run-jwt",
|
|
3694
3686
|
hostApiUrl: api.origin,
|
|
@@ -3713,7 +3705,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3713
3705
|
}
|
|
3714
3706
|
}, 20000);
|
|
3715
3707
|
it("test_route_allowlist_header_cleanup_and_token_replacement_hold_on_http2", async () => {
|
|
3716
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
3708
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-403-"));
|
|
3717
3709
|
cleanupDirs.push(rootDir);
|
|
3718
3710
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
3719
3711
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -3734,10 +3726,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3734
3726
|
runner,
|
|
3735
3727
|
effectiveCapabilities: duplexCapabilities(true),
|
|
3736
3728
|
};
|
|
3737
|
-
const bridge = await
|
|
3729
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
3738
3730
|
runId: "run-http2-403",
|
|
3739
3731
|
target,
|
|
3740
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
3732
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
3741
3733
|
adapterKey: "codex",
|
|
3742
3734
|
hostApiToken: "real-run-jwt",
|
|
3743
3735
|
hostApiUrl: api.origin,
|
|
@@ -3835,7 +3827,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3835
3827
|
if (!echoAddress || typeof echoAddress === "string") {
|
|
3836
3828
|
throw new Error("Expected the echo server to listen on a TCP port.");
|
|
3837
3829
|
}
|
|
3838
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
3830
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-raw-bytes-"));
|
|
3839
3831
|
cleanupDirs.push(rootDir);
|
|
3840
3832
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
3841
3833
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -3855,10 +3847,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3855
3847
|
runner,
|
|
3856
3848
|
effectiveCapabilities: duplexCapabilities(true),
|
|
3857
3849
|
};
|
|
3858
|
-
const bridge = await
|
|
3850
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
3859
3851
|
runId: "run-raw-bytes",
|
|
3860
3852
|
target,
|
|
3861
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
3853
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
3862
3854
|
adapterKey: "codex",
|
|
3863
3855
|
hostApiToken: "real-run-jwt",
|
|
3864
3856
|
hostApiUrl: `http://127.0.0.1:${echoAddress.port}`,
|
|
@@ -3932,7 +3924,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3932
3924
|
]);
|
|
3933
3925
|
});
|
|
3934
3926
|
it("records an http2 request span with latency and the fixed dimension keys", async () => {
|
|
3935
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
3927
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-obs-"));
|
|
3936
3928
|
cleanupDirs.push(rootDir);
|
|
3937
3929
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
3938
3930
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -3954,10 +3946,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3954
3946
|
runner,
|
|
3955
3947
|
effectiveCapabilities: duplexCapabilities(true),
|
|
3956
3948
|
};
|
|
3957
|
-
const bridge = await
|
|
3949
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
3958
3950
|
runId: "run-obs",
|
|
3959
3951
|
target,
|
|
3960
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
3952
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
3961
3953
|
adapterKey: "codex",
|
|
3962
3954
|
hostApiToken: "real-run-jwt",
|
|
3963
3955
|
hostApiUrl: api.origin,
|
|
@@ -3996,7 +3988,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
3996
3988
|
}
|
|
3997
3989
|
}, 20000);
|
|
3998
3990
|
it("increments the fallback counter with an approved reason when the capability is absent", async () => {
|
|
3999
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
3991
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-fb-"));
|
|
4000
3992
|
cleanupDirs.push(rootDir);
|
|
4001
3993
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4002
3994
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4012,10 +4004,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4012
4004
|
runner,
|
|
4013
4005
|
effectiveCapabilities: duplexCapabilities(false),
|
|
4014
4006
|
};
|
|
4015
|
-
const bridge = await
|
|
4007
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4016
4008
|
runId: "run-fb",
|
|
4017
4009
|
target,
|
|
4018
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4010
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4019
4011
|
adapterKey: "codex",
|
|
4020
4012
|
hostApiToken: "real-run-jwt",
|
|
4021
4013
|
hostApiUrl: api.origin,
|
|
@@ -4061,7 +4053,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4061
4053
|
expectedReason: "channel_open_failed",
|
|
4062
4054
|
},
|
|
4063
4055
|
])("names the open-failure stage $expectedReason and falls back to the file bridge on $name", async ({ error, expectedReason }) => {
|
|
4064
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4056
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-stage-"));
|
|
4065
4057
|
cleanupDirs.push(rootDir);
|
|
4066
4058
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4067
4059
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4083,10 +4075,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4083
4075
|
runner,
|
|
4084
4076
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4085
4077
|
};
|
|
4086
|
-
const bridge = await
|
|
4078
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4087
4079
|
runId: "run-stage",
|
|
4088
4080
|
target,
|
|
4089
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4081
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4090
4082
|
adapterKey: "codex",
|
|
4091
4083
|
hostApiToken: "real-run-jwt",
|
|
4092
4084
|
hostApiUrl: api.origin,
|
|
@@ -4113,7 +4105,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4113
4105
|
{ name: "before any dispatch", dispatchFirst: false, expectedClass: "pre_dispatch" },
|
|
4114
4106
|
{ name: "after a dispatch", dispatchFirst: true, expectedClass: "post_dispatch" },
|
|
4115
4107
|
])("increments the loss counter with the loss class $name", async ({ dispatchFirst, expectedClass }) => {
|
|
4116
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4108
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-loss-"));
|
|
4117
4109
|
cleanupDirs.push(rootDir);
|
|
4118
4110
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4119
4111
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4137,10 +4129,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4137
4129
|
runner,
|
|
4138
4130
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4139
4131
|
};
|
|
4140
|
-
const bridge = await
|
|
4132
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4141
4133
|
runId: "run-loss",
|
|
4142
4134
|
target,
|
|
4143
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4135
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4144
4136
|
adapterKey: "codex",
|
|
4145
4137
|
hostApiToken: "real-run-jwt",
|
|
4146
4138
|
hostApiUrl: api.origin,
|
|
@@ -4173,7 +4165,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4173
4165
|
}
|
|
4174
4166
|
}, 20000);
|
|
4175
4167
|
it("keeps serving the request path when the telemetry recorder throws", async () => {
|
|
4176
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4168
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-guard-"));
|
|
4177
4169
|
cleanupDirs.push(rootDir);
|
|
4178
4170
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4179
4171
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4195,10 +4187,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4195
4187
|
runner,
|
|
4196
4188
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4197
4189
|
};
|
|
4198
|
-
const bridge = await
|
|
4190
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4199
4191
|
runId: "run-guard",
|
|
4200
4192
|
target,
|
|
4201
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4193
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4202
4194
|
adapterKey: "codex",
|
|
4203
4195
|
hostApiToken: "real-run-jwt",
|
|
4204
4196
|
hostApiUrl: api.origin,
|
|
@@ -4232,7 +4224,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4232
4224
|
// error string has no code path into a sink on the http2_v1 transport, so
|
|
4233
4225
|
// this test proves the property that does need a live run: the route,
|
|
4234
4226
|
// the query, the body, and both tokens never ride a sink either.
|
|
4235
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4227
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-redact-"));
|
|
4236
4228
|
cleanupDirs.push(rootDir);
|
|
4237
4229
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4238
4230
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4264,10 +4256,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4264
4256
|
process.env.WARDMOTE_BRIDGE_DEBUG = "1";
|
|
4265
4257
|
let bridge = null;
|
|
4266
4258
|
try {
|
|
4267
|
-
bridge = await
|
|
4259
|
+
bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4268
4260
|
runId: "run-redact",
|
|
4269
4261
|
target,
|
|
4270
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4262
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4271
4263
|
adapterKey: "codex",
|
|
4272
4264
|
hostApiToken: AGENT_TOKEN_SENTINEL,
|
|
4273
4265
|
hostApiUrl: api.origin,
|
|
@@ -4314,7 +4306,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4314
4306
|
}
|
|
4315
4307
|
}, 20000);
|
|
4316
4308
|
it("maps a sentinel provider key to the constant other across every sink", async () => {
|
|
4317
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4309
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-prov-"));
|
|
4318
4310
|
cleanupDirs.push(rootDir);
|
|
4319
4311
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4320
4312
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4337,10 +4329,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4337
4329
|
runner,
|
|
4338
4330
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4339
4331
|
};
|
|
4340
|
-
const bridge = await
|
|
4332
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4341
4333
|
runId: "run-prov",
|
|
4342
4334
|
target,
|
|
4343
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4335
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4344
4336
|
adapterKey: "codex",
|
|
4345
4337
|
hostApiToken: "real-run-jwt",
|
|
4346
4338
|
hostApiUrl: api.origin,
|
|
@@ -4378,7 +4370,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4378
4370
|
}
|
|
4379
4371
|
}, 20000);
|
|
4380
4372
|
it("caps the pre-READY readiness buffer and falls back with a contaminated reason", async () => {
|
|
4381
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4373
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-cap-"));
|
|
4382
4374
|
cleanupDirs.push(rootDir);
|
|
4383
4375
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4384
4376
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4402,10 +4394,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4402
4394
|
runner,
|
|
4403
4395
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4404
4396
|
};
|
|
4405
|
-
const bridge = await
|
|
4397
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4406
4398
|
runId: "run-cap",
|
|
4407
4399
|
target,
|
|
4408
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4400
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4409
4401
|
adapterKey: "codex",
|
|
4410
4402
|
hostApiToken: "real-run-jwt",
|
|
4411
4403
|
hostApiUrl: api.origin,
|
|
@@ -4431,7 +4423,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4431
4423
|
}
|
|
4432
4424
|
}, 20000);
|
|
4433
4425
|
it("caps the pre-READY buffer under many small newline-less chunks", async () => {
|
|
4434
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4426
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-cap-small-"));
|
|
4435
4427
|
cleanupDirs.push(rootDir);
|
|
4436
4428
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4437
4429
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4459,10 +4451,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4459
4451
|
runner,
|
|
4460
4452
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4461
4453
|
};
|
|
4462
|
-
const bridge = await
|
|
4454
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4463
4455
|
runId: "run-cap-small",
|
|
4464
4456
|
target,
|
|
4465
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4457
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4466
4458
|
adapterKey: "codex",
|
|
4467
4459
|
hostApiToken: "real-run-jwt",
|
|
4468
4460
|
hostApiUrl: api.origin,
|
|
@@ -4487,7 +4479,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4487
4479
|
}
|
|
4488
4480
|
}, 20000);
|
|
4489
4481
|
it("bounds the pre-READY newline-scan work by the bytes received", async () => {
|
|
4490
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4482
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-scan-"));
|
|
4491
4483
|
cleanupDirs.push(rootDir);
|
|
4492
4484
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4493
4485
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4516,10 +4508,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4516
4508
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4517
4509
|
};
|
|
4518
4510
|
__duplexReadinessTesting.resetNewlineScanUnits();
|
|
4519
|
-
const bridge = await
|
|
4511
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4520
4512
|
runId: "run-scan-bound",
|
|
4521
4513
|
target,
|
|
4522
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4514
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4523
4515
|
adapterKey: "codex",
|
|
4524
4516
|
hostApiToken: "real-run-jwt",
|
|
4525
4517
|
hostApiUrl: api.origin,
|
|
@@ -4542,7 +4534,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4542
4534
|
}
|
|
4543
4535
|
}, 20000);
|
|
4544
4536
|
it("bounds the pre-READY buffer growth-copy work by the bytes received", async () => {
|
|
4545
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4537
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-growth-"));
|
|
4546
4538
|
cleanupDirs.push(rootDir);
|
|
4547
4539
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4548
4540
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4572,10 +4564,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4572
4564
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4573
4565
|
};
|
|
4574
4566
|
__duplexReadinessTesting.resetBufferGrowthCopyUnits();
|
|
4575
|
-
const bridge = await
|
|
4567
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4576
4568
|
runId: "run-growth-bound",
|
|
4577
4569
|
target,
|
|
4578
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4570
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4579
4571
|
adapterKey: "codex",
|
|
4580
4572
|
hostApiToken: "real-run-jwt",
|
|
4581
4573
|
hostApiUrl: api.origin,
|
|
@@ -4599,7 +4591,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4599
4591
|
}
|
|
4600
4592
|
}, 20000);
|
|
4601
4593
|
it("bounds the pre-READY skip scan work by the bytes received", async () => {
|
|
4602
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4594
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-blank-"));
|
|
4603
4595
|
cleanupDirs.push(rootDir);
|
|
4604
4596
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4605
4597
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4629,10 +4621,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4629
4621
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4630
4622
|
};
|
|
4631
4623
|
__duplexReadinessTesting.resetNewlineScanUnits();
|
|
4632
|
-
const bridge = await
|
|
4624
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4633
4625
|
runId: "run-blank-scan",
|
|
4634
4626
|
target,
|
|
4635
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4627
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4636
4628
|
adapterKey: "codex",
|
|
4637
4629
|
hostApiToken: "real-run-jwt",
|
|
4638
4630
|
hostApiUrl: api.origin,
|
|
@@ -4660,7 +4652,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4660
4652
|
}
|
|
4661
4653
|
}, 20000);
|
|
4662
4654
|
it("test_a_prologue_of_any_length_before_the_ready_line_is_discarded", async () => {
|
|
4663
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4655
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-noise-"));
|
|
4664
4656
|
cleanupDirs.push(rootDir);
|
|
4665
4657
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4666
4658
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4688,10 +4680,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4688
4680
|
runner,
|
|
4689
4681
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4690
4682
|
};
|
|
4691
|
-
const bridge = await
|
|
4683
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4692
4684
|
runId: "run-noise-ready",
|
|
4693
4685
|
target,
|
|
4694
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4686
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4695
4687
|
adapterKey: "codex",
|
|
4696
4688
|
hostApiToken: "real-run-jwt",
|
|
4697
4689
|
hostApiUrl: api.origin,
|
|
@@ -4715,7 +4707,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4715
4707
|
}
|
|
4716
4708
|
}, 20000);
|
|
4717
4709
|
it("settles a wrong-nonce READY frame as a nonce mismatch, even after a noise line", async () => {
|
|
4718
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4710
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-noise-nonce-"));
|
|
4719
4711
|
cleanupDirs.push(rootDir);
|
|
4720
4712
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4721
4713
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4738,10 +4730,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4738
4730
|
runner,
|
|
4739
4731
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4740
4732
|
};
|
|
4741
|
-
const bridge = await
|
|
4733
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4742
4734
|
runId: "run-noise-nonce",
|
|
4743
4735
|
target,
|
|
4744
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4736
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4745
4737
|
adapterKey: "codex",
|
|
4746
4738
|
hostApiToken: "real-run-jwt",
|
|
4747
4739
|
hostApiUrl: api.origin,
|
|
@@ -4765,7 +4757,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4765
4757
|
}
|
|
4766
4758
|
}, 20000);
|
|
4767
4759
|
it("enforces the buffer cap on an over-cap blank prefix before it accepts a valid READY frame", async () => {
|
|
4768
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4760
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-capbypass-"));
|
|
4769
4761
|
cleanupDirs.push(rootDir);
|
|
4770
4762
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4771
4763
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4794,10 +4786,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4794
4786
|
runner,
|
|
4795
4787
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4796
4788
|
};
|
|
4797
|
-
const bridge = await
|
|
4789
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4798
4790
|
runId: "run-cap-bypass",
|
|
4799
4791
|
target,
|
|
4800
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4792
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4801
4793
|
adapterKey: "codex",
|
|
4802
4794
|
hostApiToken: "real-run-jwt",
|
|
4803
4795
|
hostApiUrl: api.origin,
|
|
@@ -4822,7 +4814,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4822
4814
|
}
|
|
4823
4815
|
}, 20000);
|
|
4824
4816
|
it("records the channel-open span with the fallback_reason dimension on the fallback path", async () => {
|
|
4825
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4817
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-duplex-openspan-"));
|
|
4826
4818
|
cleanupDirs.push(rootDir);
|
|
4827
4819
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4828
4820
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4842,10 +4834,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4842
4834
|
runner,
|
|
4843
4835
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4844
4836
|
};
|
|
4845
|
-
const bridge = await
|
|
4837
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4846
4838
|
runId: "run-open-span",
|
|
4847
4839
|
target,
|
|
4848
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4840
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4849
4841
|
adapterKey: "codex",
|
|
4850
4842
|
hostApiToken: "real-run-jwt",
|
|
4851
4843
|
hostApiUrl: api.origin,
|
|
@@ -4872,7 +4864,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4872
4864
|
}
|
|
4873
4865
|
}, 20000);
|
|
4874
4866
|
it("drops a header outside the allowlist on the host http2 forward path", async () => {
|
|
4875
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4867
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-hdr-"));
|
|
4876
4868
|
cleanupDirs.push(rootDir);
|
|
4877
4869
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4878
4870
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4893,10 +4885,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4893
4885
|
runner,
|
|
4894
4886
|
effectiveCapabilities: duplexCapabilities(true),
|
|
4895
4887
|
};
|
|
4896
|
-
const bridge = await
|
|
4888
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4897
4889
|
runId: "run-hdr",
|
|
4898
4890
|
target,
|
|
4899
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4891
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4900
4892
|
adapterKey: "codex",
|
|
4901
4893
|
hostApiToken: "real-run-jwt",
|
|
4902
4894
|
hostApiUrl: api.origin,
|
|
@@ -4934,7 +4926,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4934
4926
|
}
|
|
4935
4927
|
}, 20000);
|
|
4936
4928
|
it("selects the http2 transport for a large forward budget", async () => {
|
|
4937
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4929
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-budget-"));
|
|
4938
4930
|
cleanupDirs.push(rootDir);
|
|
4939
4931
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4940
4932
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -4959,10 +4951,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4959
4951
|
// holds no nested-budget derivation (that budget set belonged to the retired
|
|
4960
4952
|
// duplex_v1 broker only), so a large forward budget must still select and
|
|
4961
4953
|
// serve normally.
|
|
4962
|
-
const bridge = await
|
|
4954
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
4963
4955
|
runId: "run-budget",
|
|
4964
4956
|
target,
|
|
4965
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
4957
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
4966
4958
|
adapterKey: "codex",
|
|
4967
4959
|
hostApiToken: "real-run-jwt",
|
|
4968
4960
|
hostApiUrl: api.origin,
|
|
@@ -4986,7 +4978,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
4986
4978
|
}
|
|
4987
4979
|
}, 20000);
|
|
4988
4980
|
it("test_a_missing_preface_aborts_the_open_and_falls_back_to_queue_v1", async () => {
|
|
4989
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
4981
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-no-preface-"));
|
|
4990
4982
|
cleanupDirs.push(rootDir);
|
|
4991
4983
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
4992
4984
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5010,10 +5002,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5010
5002
|
runner,
|
|
5011
5003
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5012
5004
|
};
|
|
5013
|
-
const bridge = await
|
|
5005
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5014
5006
|
runId: "run-no-preface",
|
|
5015
5007
|
target,
|
|
5016
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5008
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5017
5009
|
adapterKey: "codex",
|
|
5018
5010
|
hostApiToken: "real-run-jwt",
|
|
5019
5011
|
hostApiUrl: api.origin,
|
|
@@ -5039,7 +5031,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5039
5031
|
}
|
|
5040
5032
|
}, 20000);
|
|
5041
5033
|
it("test_disabled_flag_selects_queue_v1", async () => {
|
|
5042
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5034
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-disabled-"));
|
|
5043
5035
|
cleanupDirs.push(rootDir);
|
|
5044
5036
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5045
5037
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5056,10 +5048,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5056
5048
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5057
5049
|
};
|
|
5058
5050
|
// The kill switch is off. The host must never open the channel at all.
|
|
5059
|
-
const bridge = await
|
|
5051
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5060
5052
|
runId: "run-disabled",
|
|
5061
5053
|
target,
|
|
5062
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5054
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5063
5055
|
adapterKey: "codex",
|
|
5064
5056
|
hostApiToken: "real-run-jwt",
|
|
5065
5057
|
hostApiUrl: api.origin,
|
|
@@ -5082,7 +5074,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5082
5074
|
// The open attempt runs once per run, with no retry loop: a preface
|
|
5083
5075
|
// failure falls through to the file bridge exactly one time, and the
|
|
5084
5076
|
// host never re-attempts http2_v1 afterward in the same run.
|
|
5085
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5077
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-one-way-"));
|
|
5086
5078
|
cleanupDirs.push(rootDir);
|
|
5087
5079
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5088
5080
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5101,10 +5093,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5101
5093
|
runner,
|
|
5102
5094
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5103
5095
|
};
|
|
5104
|
-
const bridge = await
|
|
5096
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5105
5097
|
runId: "run-one-way",
|
|
5106
5098
|
target,
|
|
5107
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5099
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5108
5100
|
adapterKey: "codex",
|
|
5109
5101
|
hostApiToken: "real-run-jwt",
|
|
5110
5102
|
hostApiUrl: api.origin,
|
|
@@ -5136,7 +5128,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5136
5128
|
// READY: it holds the channel open, with no client preface arriving
|
|
5137
5129
|
// (so the http2 server, if bound, would try to write its own SETTINGS
|
|
5138
5130
|
// frame), and asserts zero bytes crossed the channel the whole time.
|
|
5139
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5131
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-no-early-write-"));
|
|
5140
5132
|
cleanupDirs.push(rootDir);
|
|
5141
5133
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5142
5134
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5182,10 +5174,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5182
5174
|
runner,
|
|
5183
5175
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5184
5176
|
};
|
|
5185
|
-
const bridge = await
|
|
5177
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5186
5178
|
runId: "run-no-early-write",
|
|
5187
5179
|
target,
|
|
5188
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5180
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5189
5181
|
adapterKey: "codex",
|
|
5190
5182
|
hostApiToken: "real-run-jwt",
|
|
5191
5183
|
hostApiUrl: api.origin,
|
|
@@ -5211,7 +5203,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5211
5203
|
// bytes are deliberately sentinel-marked and syntactically invalid (not
|
|
5212
5204
|
// valid UTF-8 JSON), then a valid READY frame. No log line — on any
|
|
5213
5205
|
// stream — may contain the sentinel bytes.
|
|
5214
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5206
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-invalid-ready-bytes-"));
|
|
5215
5207
|
cleanupDirs.push(rootDir);
|
|
5216
5208
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5217
5209
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5234,10 +5226,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5234
5226
|
runner,
|
|
5235
5227
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5236
5228
|
};
|
|
5237
|
-
const bridge = await
|
|
5229
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5238
5230
|
runId: "run-invalid-ready-bytes",
|
|
5239
5231
|
target,
|
|
5240
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5232
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5241
5233
|
adapterKey: "codex",
|
|
5242
5234
|
hostApiToken: "real-run-jwt",
|
|
5243
5235
|
hostApiUrl: api.origin,
|
|
@@ -5261,7 +5253,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5261
5253
|
// A loss ordered after a host-observed orderly completion is a normal
|
|
5262
5254
|
// teardown, not a failure: the run already completed. The disposition
|
|
5263
5255
|
// latch must keep the success and emit no loss event for it.
|
|
5264
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5256
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-orderly-close-"));
|
|
5265
5257
|
cleanupDirs.push(rootDir);
|
|
5266
5258
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5267
5259
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5282,10 +5274,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5282
5274
|
runner,
|
|
5283
5275
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5284
5276
|
};
|
|
5285
|
-
const bridge = await
|
|
5277
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5286
5278
|
runId: "run-orderly-close",
|
|
5287
5279
|
target,
|
|
5288
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5280
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5289
5281
|
adapterKey: "codex",
|
|
5290
5282
|
hostApiToken: "real-run-jwt",
|
|
5291
5283
|
hostApiUrl: api.origin,
|
|
@@ -5315,7 +5307,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5315
5307
|
// retryable: the host answers 502 with no indeterminate marker, the same
|
|
5316
5308
|
// rule `forwardBridgeRequest` already applies on every transport. This
|
|
5317
5309
|
// proves the http2_v1 forward handler reuses that one function unchanged.
|
|
5318
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5310
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-safe-retry-"));
|
|
5319
5311
|
cleanupDirs.push(rootDir);
|
|
5320
5312
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5321
5313
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5336,10 +5328,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5336
5328
|
runner,
|
|
5337
5329
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5338
5330
|
};
|
|
5339
|
-
const bridge = await
|
|
5331
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5340
5332
|
runId: "run-safe-retry",
|
|
5341
5333
|
target,
|
|
5342
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5334
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5343
5335
|
adapterKey: "codex",
|
|
5344
5336
|
hostApiToken: "real-run-jwt",
|
|
5345
5337
|
hostApiUrl: api.origin,
|
|
@@ -5357,7 +5349,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5357
5349
|
headers: { authorization: `Bearer ${bridgeToken}` },
|
|
5358
5350
|
});
|
|
5359
5351
|
expect(response.status).toBe(502);
|
|
5360
|
-
expect(response.headers["x-
|
|
5352
|
+
expect(response.headers["x-wardmote-bridge-outcome"]).toBeUndefined();
|
|
5361
5353
|
}
|
|
5362
5354
|
finally {
|
|
5363
5355
|
sessionRef.current?.close();
|
|
@@ -5375,7 +5367,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5375
5367
|
// host and the gateway share one resolved ceiling: this request carries
|
|
5376
5368
|
// no body, so only the mock host's own response — comfortably over one
|
|
5377
5369
|
// byte — trips the size check this test exists to force.
|
|
5378
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5370
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-unsafe-indeterminate-"));
|
|
5379
5371
|
cleanupDirs.push(rootDir);
|
|
5380
5372
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5381
5373
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5396,10 +5388,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5396
5388
|
runner,
|
|
5397
5389
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5398
5390
|
};
|
|
5399
|
-
const bridge = await
|
|
5391
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5400
5392
|
runId: "run-unsafe-indeterminate",
|
|
5401
5393
|
target,
|
|
5402
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5394
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5403
5395
|
adapterKey: "codex",
|
|
5404
5396
|
hostApiToken: "real-run-jwt",
|
|
5405
5397
|
hostApiUrl: api.origin,
|
|
@@ -5415,7 +5407,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5415
5407
|
headers: { authorization: `Bearer ${bridgeToken}`, "content-type": "application/json" },
|
|
5416
5408
|
});
|
|
5417
5409
|
expect(response.status).toBe(504);
|
|
5418
|
-
expect(response.headers["x-
|
|
5410
|
+
expect(response.headers["x-wardmote-bridge-outcome"]).toBe("indeterminate");
|
|
5419
5411
|
}
|
|
5420
5412
|
finally {
|
|
5421
5413
|
sessionRef.current?.close();
|
|
@@ -5449,7 +5441,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5449
5441
|
throw new Error("Expected the mock host server to listen on a TCP port.");
|
|
5450
5442
|
}
|
|
5451
5443
|
const apiOrigin = `http://127.0.0.1:${apiAddress.port}`;
|
|
5452
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5444
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-abort-forward-"));
|
|
5453
5445
|
cleanupDirs.push(rootDir);
|
|
5454
5446
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5455
5447
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5469,10 +5461,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5469
5461
|
runner,
|
|
5470
5462
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5471
5463
|
};
|
|
5472
|
-
const bridge = await
|
|
5464
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5473
5465
|
runId: "run-abort-forward",
|
|
5474
5466
|
target,
|
|
5475
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5467
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5476
5468
|
adapterKey: "codex",
|
|
5477
5469
|
hostApiToken: "real-run-jwt",
|
|
5478
5470
|
hostApiUrl: apiOrigin,
|
|
@@ -5531,7 +5523,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5531
5523
|
throw new Error("Expected the mock host server to listen on a TCP port.");
|
|
5532
5524
|
}
|
|
5533
5525
|
const apiOrigin = `http://127.0.0.1:${apiAddress.port}`;
|
|
5534
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5526
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-denied-response-chunk-"));
|
|
5535
5527
|
cleanupDirs.push(rootDir);
|
|
5536
5528
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5537
5529
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5551,10 +5543,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5551
5543
|
runner,
|
|
5552
5544
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5553
5545
|
};
|
|
5554
|
-
const bridge = await
|
|
5546
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5555
5547
|
runId: "run-denied-response-chunk",
|
|
5556
5548
|
target,
|
|
5557
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5549
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5558
5550
|
adapterKey: "codex",
|
|
5559
5551
|
hostApiToken: "real-run-jwt",
|
|
5560
5552
|
hostApiUrl: apiOrigin,
|
|
@@ -5616,7 +5608,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5616
5608
|
throw new Error("Expected the mock host server to listen on a TCP port.");
|
|
5617
5609
|
}
|
|
5618
5610
|
const apiOrigin = `http://127.0.0.1:${apiAddress.port}`;
|
|
5619
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5611
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-denied-response-concat-"));
|
|
5620
5612
|
cleanupDirs.push(rootDir);
|
|
5621
5613
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5622
5614
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5636,10 +5628,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5636
5628
|
runner,
|
|
5637
5629
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5638
5630
|
};
|
|
5639
|
-
const bridge = await
|
|
5631
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5640
5632
|
runId: "run-denied-response-concat",
|
|
5641
5633
|
target,
|
|
5642
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5634
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5643
5635
|
adapterKey: "codex",
|
|
5644
5636
|
hostApiToken: "real-run-jwt",
|
|
5645
5637
|
hostApiUrl: apiOrigin,
|
|
@@ -5728,7 +5720,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5728
5720
|
throw new Error("Expected the mock host server to listen on a TCP port.");
|
|
5729
5721
|
}
|
|
5730
5722
|
const apiOrigin = `http://127.0.0.1:${apiAddress.port}`;
|
|
5731
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5723
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-denied-response-mutation-"));
|
|
5732
5724
|
cleanupDirs.push(rootDir);
|
|
5733
5725
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5734
5726
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5748,10 +5740,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5748
5740
|
runner,
|
|
5749
5741
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5750
5742
|
};
|
|
5751
|
-
const bridge = await
|
|
5743
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5752
5744
|
runId: "run-denied-response-mutation",
|
|
5753
5745
|
target,
|
|
5754
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5746
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5755
5747
|
adapterKey: "codex",
|
|
5756
5748
|
hostApiToken: "real-run-jwt",
|
|
5757
5749
|
hostApiUrl: apiOrigin,
|
|
@@ -5766,7 +5758,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5766
5758
|
headers: { authorization: `Bearer ${bridgeToken}`, "content-type": "application/json" },
|
|
5767
5759
|
});
|
|
5768
5760
|
expect(response.status).toBe(504);
|
|
5769
|
-
expect(response.headers["x-
|
|
5761
|
+
expect(response.headers["x-wardmote-bridge-outcome"]).toBe("indeterminate");
|
|
5770
5762
|
expect(JSON.parse(response.body.toString("utf8"))).toMatchObject({
|
|
5771
5763
|
outcome: "indeterminate",
|
|
5772
5764
|
retryable: false,
|
|
@@ -5806,7 +5798,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5806
5798
|
throw new Error("Expected the mock host server to listen on a TCP port.");
|
|
5807
5799
|
}
|
|
5808
5800
|
const apiOrigin = `http://127.0.0.1:${apiAddress.port}`;
|
|
5809
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5801
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-ceiling-aggregate-"));
|
|
5810
5802
|
cleanupDirs.push(rootDir);
|
|
5811
5803
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5812
5804
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5826,10 +5818,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5826
5818
|
runner,
|
|
5827
5819
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5828
5820
|
};
|
|
5829
|
-
const bridge = await
|
|
5821
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5830
5822
|
runId: "run-ceiling-aggregate",
|
|
5831
5823
|
target,
|
|
5832
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5824
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5833
5825
|
adapterKey: "codex",
|
|
5834
5826
|
hostApiToken: "real-run-jwt",
|
|
5835
5827
|
hostApiUrl: apiOrigin,
|
|
@@ -5871,7 +5863,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5871
5863
|
ctx.emitReady();
|
|
5872
5864
|
sessionRef.current = ctx.connectHttp2();
|
|
5873
5865
|
});
|
|
5874
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5866
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-host-body-limit-"));
|
|
5875
5867
|
cleanupDirs.push(rootDir);
|
|
5876
5868
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5877
5869
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -5884,10 +5876,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5884
5876
|
runner,
|
|
5885
5877
|
effectiveCapabilities: duplexCapabilities(true),
|
|
5886
5878
|
};
|
|
5887
|
-
const bridge = await
|
|
5879
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5888
5880
|
runId: "run-host-body-limit",
|
|
5889
5881
|
target,
|
|
5890
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
5882
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
5891
5883
|
adapterKey: "codex",
|
|
5892
5884
|
hostApiToken: "real-run-jwt",
|
|
5893
5885
|
hostApiUrl: api.origin,
|
|
@@ -5929,10 +5921,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5929
5921
|
// with no `reservation` option at all. `readBridgeForwardResponseBody`
|
|
5930
5922
|
// must behave exactly as it did before that option existed: it still
|
|
5931
5923
|
// forwards the request and still returns the host's body.
|
|
5932
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5924
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-queue-no-reservation-"));
|
|
5933
5925
|
cleanupDirs.push(rootDir);
|
|
5934
5926
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5935
|
-
const runtimeRootDir = path.join(remoteCwd, ".
|
|
5927
|
+
const runtimeRootDir = path.join(remoteCwd, ".wardmote-runtime", "codex");
|
|
5936
5928
|
await mkdir(runtimeRootDir, { recursive: true });
|
|
5937
5929
|
const apiServer = createServer((req, res) => {
|
|
5938
5930
|
res.writeHead(201, { "content-type": "application/json" });
|
|
@@ -5956,7 +5948,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5956
5948
|
runner: createLocalSandboxRunner(),
|
|
5957
5949
|
timeoutMs: 30_000,
|
|
5958
5950
|
};
|
|
5959
|
-
const bridge = await
|
|
5951
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
5960
5952
|
runId: "run-queue-no-reservation",
|
|
5961
5953
|
target,
|
|
5962
5954
|
runtimeRootDir,
|
|
@@ -5992,7 +5984,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
5992
5984
|
// rather than against synthetic frames.
|
|
5993
5985
|
// ---------------------------------------------------------------------------
|
|
5994
5986
|
async function runReadinessReplay(emit) {
|
|
5995
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
5987
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-pty-replay-"));
|
|
5996
5988
|
cleanupDirs.push(rootDir);
|
|
5997
5989
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
5998
5990
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -6009,10 +6001,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
6009
6001
|
runner,
|
|
6010
6002
|
effectiveCapabilities: duplexCapabilities(true),
|
|
6011
6003
|
};
|
|
6012
|
-
const bridge = await
|
|
6004
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
6013
6005
|
runId: "run-pty-replay",
|
|
6014
6006
|
target,
|
|
6015
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
6007
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
6016
6008
|
adapterKey: "codex",
|
|
6017
6009
|
hostApiToken: "real-run-jwt",
|
|
6018
6010
|
hostApiUrl: api.origin,
|
|
@@ -6029,7 +6021,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
6029
6021
|
// on its own clean line.
|
|
6030
6022
|
it("PTY replay: accepts READY after an echoed prompt and wrapper line", async () => {
|
|
6031
6023
|
const { mode } = await runReadinessReplay((ctx) => {
|
|
6032
|
-
ctx.emitRaw("daytona@212487a7f3c9:~$ exec 2>'/tmp/
|
|
6024
|
+
ctx.emitRaw("daytona@212487a7f3c9:~$ exec 2>'/tmp/wardmote-duplex-x.log'; stty raw -echo; " +
|
|
6033
6025
|
"exec 'bash' '-c' 'exec env WARDMOTE_BRIDGE_NONCE=" + ctx.nonce + " node gateway.mjs'\r\n");
|
|
6034
6026
|
ctx.emitRaw('{"version":2,"type":"ready","nonce":"' + ctx.nonce + '"}\n');
|
|
6035
6027
|
ctx.connectHttp2();
|
|
@@ -6115,7 +6107,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
6115
6107
|
// HTTP/2 server. A pre-preface byte would make the server report a
|
|
6116
6108
|
// `PROTOCOL_ERROR`; this test proves the real session opens cleanly
|
|
6117
6109
|
// instead, which only holds when the offset is exact.
|
|
6118
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
6110
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-preface-offset-"));
|
|
6119
6111
|
cleanupDirs.push(rootDir);
|
|
6120
6112
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
6121
6113
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -6138,10 +6130,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
6138
6130
|
runner,
|
|
6139
6131
|
effectiveCapabilities: duplexCapabilities(true),
|
|
6140
6132
|
};
|
|
6141
|
-
const bridge = await
|
|
6133
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
6142
6134
|
runId: "run-preface-offset",
|
|
6143
6135
|
target,
|
|
6144
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
6136
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
6145
6137
|
adapterKey: "codex",
|
|
6146
6138
|
hostApiToken: "real-run-jwt",
|
|
6147
6139
|
hostApiUrl: api.origin,
|
|
@@ -6170,7 +6162,7 @@ describe("sandbox adapter execution targets", () => {
|
|
|
6170
6162
|
// the shell. This test embeds the exact preface bytes in the pre-READY
|
|
6171
6163
|
// noise, then proves a session still starts only at the REAL preface
|
|
6172
6164
|
// that follows READY.
|
|
6173
|
-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "
|
|
6165
|
+
const rootDir = await mkdtemp(path.join(os.tmpdir(), "wardmote-http2-preface-lookalike-"));
|
|
6174
6166
|
cleanupDirs.push(rootDir);
|
|
6175
6167
|
const remoteCwd = path.join(rootDir, "workspace");
|
|
6176
6168
|
await mkdir(remoteCwd, { recursive: true });
|
|
@@ -6193,10 +6185,10 @@ describe("sandbox adapter execution targets", () => {
|
|
|
6193
6185
|
runner,
|
|
6194
6186
|
effectiveCapabilities: duplexCapabilities(true),
|
|
6195
6187
|
};
|
|
6196
|
-
const bridge = await
|
|
6188
|
+
const bridge = await startAdapterExecutionTargetWardmoteBridge({
|
|
6197
6189
|
runId: "run-preface-lookalike",
|
|
6198
6190
|
target,
|
|
6199
|
-
runtimeRootDir: path.join(remoteCwd, ".
|
|
6191
|
+
runtimeRootDir: path.join(remoteCwd, ".wardmote-runtime", "codex"),
|
|
6200
6192
|
adapterKey: "codex",
|
|
6201
6193
|
hostApiToken: "real-run-jwt",
|
|
6202
6194
|
hostApiUrl: api.origin,
|