test(runner): bind the Grok lock variable across the sandbox and launcher tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nicky LeachandClaude Opus 5.5 committed 2026-11-19 17:03:54 -08:00
1 parent 8cae8cc931
commit 695d590802
2 files changed
+5 -2

No files matched your search

@@ -41,7 +41,7 @@ import {
type VerifiedAcpxProviderLifetime,
} from "./installation-integrity.js";
import { stageManagedCodexCredential } from "./codex-credentials.js";
import { grokRequirements } from "./runtime-sandbox.js";
import { GROK_REQUIREMENTS_ENV, grokRequirements } from "./runtime-sandbox.js";
async function withLinuxX64TestPlatform<T>(run: () => Promise<T>): Promise<T> {
const platformDescriptor = Object.getOwnPropertyDescriptor(process, "platform");
@@ -2375,7 +2375,7 @@ describe("Grok launcher subscription refresh", () => {
process: { env: {
PAPERCLIP_GROK_VERIFIED_EXECUTABLE: executable, GROK_HOME: input.grokHome ?? "/isolated/grok",
...(input.apiKey ? { XAI_API_KEY: input.apiKey } : {}),
...(input.requirements === undefined ? {} : { PAPERCLIP_GROK_REQUIREMENTS: input.requirements }),
...(input.requirements === undefined ? {} : { [GROK_REQUIREMENTS_ENV]: input.requirements }),
}, pid: 4242, getuid: () => 1000, execve },
require: (name: string) => name === "node:path" ? { isAbsolute, join } : name === "node:fs" ? fs : name === "node:child_process" ? { spawnSync } : undefined,
}) };
@@ -24,6 +24,7 @@ import { acpxSidecarErrorCode } from "../../cli/acpx-sidecar-input.js";
import { resolveQualifiedAcpxProfile } from "./qualified-profiles.js";
import { createAcpxRecoveryBinding } from "./recovery-identity.js";
import {
GROK_REQUIREMENTS_ENV,
prepareAcpxRuntimeSandbox,
refreshCopilotSystemInstructions,
readAcpxRecoveryWorkspace,
@@ -146,6 +147,8 @@ describe("ACPX runtime sandbox", () => {
expect(await readFile(join(sandbox.agentHomeDirectory, "config.toml"), "utf8")).toContain(`disable_web_search = ${disabled}`);
const requirements = await readFile(join(sandbox.agentHomeDirectory, "requirements.toml"), "utf8");
expect(requirements.includes("disable_web_search = true")).toBe(disabled);
expect(sandbox.launchEnvironment[GROK_REQUIREMENTS_ENV]).toBe(requirements);
expect(sandbox.persistedEnvironment).not.toHaveProperty(GROK_REQUIREMENTS_ENV);
});
it("keeps provider credentials outside identity-enabled Codex shell commands", async () => {