diff --git a/src/commands/credentials.test.ts b/src/commands/credentials.test.ts index d102a91bc3a..a14fd7bcfd0 100644 --- a/src/commands/credentials.test.ts +++ b/src/commands/credentials.test.ts @@ -259,6 +259,7 @@ describe("credentials oclif adapter source coverage", () => { "tavily-hermes-v1", "--from-existing", ], + ["provider", "profile", "-g", "nemoclaw", "export", "tavily-hermes-v1", "--output", "json"], ]); } finally { log.mockRestore(); diff --git a/src/lib/actions/sandbox/mcp-bridge-add-restart.ts b/src/lib/actions/sandbox/mcp-bridge-add-restart.ts index 018ba8af399..ae05519d5e2 100644 --- a/src/lib/actions/sandbox/mcp-bridge-add-restart.ts +++ b/src/lib/actions/sandbox/mcp-bridge-add-restart.ts @@ -57,6 +57,7 @@ import { waitForAttachedMcpCredential, waitForDetachedMcpCredential, } from "./mcp-bridge-provider"; +import { createMcpProviderAdapterBoundary } from "./mcp-bridge-provider-inspection"; import { assertNoAmbiguousMcpCredentialTarget, assertNoAmbiguousMcpCredentialTargets, @@ -900,7 +901,8 @@ async function addMcpBridgeUnlocked( // supplied by a foreign attachment before opening its MCP route, then check // again after provider creation to close the intervening race. await assertNoProviderCredentialCollisions(sandboxName, [entry], providerRuntimeSelection); - await ensureMcpBridgeProviderProfile(providerRuntimeSelection); + const providerAdapter = createMcpProviderAdapterBoundary(providerRuntimeSelection).adapter; + await ensureMcpBridgeProviderProfile(providerRuntimeSelection, providerAdapter); // Load the real protocol:mcp policy without a credential binding before // provider mutation. OpenShell requires the endpointless provider to be // attached before it accepts credential_binding.provider, and withholds @@ -919,6 +921,7 @@ async function addMcpBridgeUnlocked( allowExisting: recovery.resuming, expectedProviderId: entry.providerId, runtimeSelection: providerRuntimeSelection, + providerAdapter, prepareMutation: async (action) => { // A fresh create has no prior revision to compare. Observe only the // bounded placeholder classification for an actual update, after the @@ -950,7 +953,7 @@ async function addMcpBridgeUnlocked( } if (!recovery.attachmentPresent) { providerAttachAttempted = true; - await attachProvider(sandboxName, entry, providerRuntimeSelection); + await attachProvider(sandboxName, entry, providerRuntimeSelection, providerAdapter); } if (recovery.policyState !== "bound") { await applyGeneratedPolicy(sandboxName, entry, target, { @@ -993,6 +996,7 @@ async function addMcpBridgeUnlocked( expectedProviderId: entry.providerId, requireExisting: true, runtimeSelection: providerRuntimeSelection, + providerAdapter, }); if (republished.action !== "updated") { await refreshMcpProviderEnvironment(entry, providerRuntimeSelection); @@ -1012,6 +1016,7 @@ async function addMcpBridgeUnlocked( expectedProviderId: entry.providerId, requireExisting: true, runtimeSelection: providerRuntimeSelection, + providerAdapter, }); credentialRevision = await waitForAttachedMcpCredential( sandboxName, diff --git a/src/lib/actions/sandbox/mcp-bridge-provider.test.ts b/src/lib/actions/sandbox/mcp-bridge-provider.test.ts index 7bc27c394cf..cc1e0aa5048 100644 --- a/src/lib/actions/sandbox/mcp-bridge-provider.test.ts +++ b/src/lib/actions/sandbox/mcp-bridge-provider.test.ts @@ -11,6 +11,7 @@ import { buildMcpCredentialRevisionObservationCommand } from "./mcp-bridge"; import { assertNoAttachedProviderCredentialCollisions, assertNoRegisteredProviderCredentialCollisions, + createMcpProviderAdapterBoundary, providerMatchesCredential, providerMatchesManagedCredential, } from "./mcp-bridge-provider-inspection"; @@ -194,7 +195,9 @@ describe("OpenShell MCP provider state", () => { const commandFamilies = new Set(); let providerExists = false; let providerAttached = false; + let profileChanged = false; let resourceVersion = 0; + const warn = vi.spyOn(console, "warn").mockImplementation(() => undefined); const providerOutput = () => providerMetadataOutput( "alpha-mcp-fake", @@ -228,7 +231,7 @@ describe("OpenShell MCP provider state", () => { commandFamilies.add("profile"); return { status: 0, - stdout: profileOutput(args[3], args[3] === "openai"), + stdout: profileOutput(args[3], profileChanged), stderr: "", }; case "provider get alpha-mcp-fake": @@ -239,6 +242,7 @@ describe("OpenShell MCP provider state", () => { case "provider create --name": commandFamilies.add("create"); providerExists = true; + profileChanged = true; resourceVersion = 1; return { status: 0, stdout: "Created", stderr: "" }; case "provider update alpha-mcp-fake": @@ -284,11 +288,18 @@ describe("OpenShell MCP provider state", () => { }); providerCommand.setProviderCommandRuntimeHooksForTest({ runOpenshell: runOpenshell as never }); - await ensureMcpBridgeProviderProfile(runtimeSelection); + const providerAdapter = createMcpProviderAdapterBoundary(runtimeSelection).adapter; + await ensureMcpBridgeProviderProfile(runtimeSelection, providerAdapter); const created = await upsertMcpProvider("alpha-mcp-fake", [{ name: "EXPECTED_TOKEN" }], { allowExisting: false, runtimeSelection, + providerAdapter, }); + expect(warn).toHaveBeenCalledOnce(); + expect(warn.mock.calls[0]?.[0]).toContain( + "cannot confirm which definition was used at bind time", + ); + expect(warn.mock.calls[0]?.[0]).not.toContain("host-only-secret"); const entry: McpSourceEntry = { server: "fake", agent: "openclaw", @@ -299,7 +310,9 @@ describe("OpenShell MCP provider state", () => { providerId: created.inspection.id ?? undefined, policyName: "mcp-bridge-fake", }; - await attachProvider("alpha", entry, runtimeSelection); + await attachProvider("alpha", entry, runtimeSelection, providerAdapter); + expect(warn).toHaveBeenCalledTimes(2); + expect(warn.mock.calls[1]?.[0]).not.toContain("host-only-secret"); await refreshMcpProviderEnvironment(entry, runtimeSelection); await expect(detachProvider("alpha", entry, { runtimeSelection })).resolves.toBe("detached"); diff --git a/src/lib/actions/sandbox/mcp-bridge-restart.ts b/src/lib/actions/sandbox/mcp-bridge-restart.ts index a616e16792b..67141bdef21 100644 --- a/src/lib/actions/sandbox/mcp-bridge-restart.ts +++ b/src/lib/actions/sandbox/mcp-bridge-restart.ts @@ -27,6 +27,7 @@ import { preflightMcpEntryTargets, waitForAttachedMcpCredential, } from "./mcp-bridge-provider"; +import { createMcpProviderAdapterBoundary } from "./mcp-bridge-provider-inspection"; import { assertMcpAdapterMutationRuntimeCapabilities, assertMcpAdapterTeardownRuntimeCapabilities, @@ -260,7 +261,8 @@ export async function restoreExistingMcpBridgeRuntime( [entry], providerRuntimeSelection, ); - await ensureMcpBridgeProviderProfile(providerRuntimeSelection); + const providerAdapter = createMcpProviderAdapterBoundary(providerRuntimeSelection).adapter; + await ensureMcpBridgeProviderProfile(providerRuntimeSelection, providerAdapter); if (options.applyPolicy !== false) { await applyGeneratedPolicy( sandboxName, @@ -272,7 +274,7 @@ export async function restoreExistingMcpBridgeRuntime( }, ); } - await attachProvider(sandboxName, entry, providerRuntimeSelection); + await attachProvider(sandboxName, entry, providerRuntimeSelection, providerAdapter); if (options.applyPolicy !== false) { await applyGeneratedPolicy( sandboxName, diff --git a/src/lib/adapters/openshell/provider-adapter-cli-profile-warning.test.ts b/src/lib/adapters/openshell/provider-adapter-cli-profile-warning.test.ts new file mode 100644 index 00000000000..52af0674b4d --- /dev/null +++ b/src/lib/adapters/openshell/provider-adapter-cli-profile-warning.test.ts @@ -0,0 +1,255 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +import { describe, expect, it, vi } from "vitest"; + +import { createCliOpenShellProviderAdapter, type RunProviderCommand } from "./provider-adapter-cli"; +import { namedOpenShellGateway } from "./sandbox-observer"; + +const PROFILE = { + id: "test-profile", + credentials: [ + { + name: "token", + env_vars: ["TEST_TOKEN"], + required: true, + auth_style: "header", + header_name: "Authorization", + query_param: "", + }, + ], + endpoints: [], + binaries: [], + inference_capable: false, +}; +const PROFILE_YAML = ` +id: test-profile +credentials: + - name: token + env_vars: [TEST_TOKEN] + required: true + auth_style: header + header_name: Authorization + query_param: '' +endpoints: [] +binaries: [] +inference_capable: false +`; +const TARGET = namedOpenShellGateway("nemoclaw"); +const SECRET = "credential-value"; +const PROFILE_EXPORT_ARGS = [ + "provider", + "profile", + "-g", + "nemoclaw", + "export", + PROFILE.id, + "--output", + "json", +]; + +function captured(status: number | null, stdout = "", stderr = "", error?: Error) { + return { status, stdout, stderr, ...(error ? { error } : {}) }; +} + +function createProviderRequest() { + return { + target: TARGET, + name: "test-provider", + type: PROFILE.id, + credentials: [{ name: "TEST_TOKEN", value: SECRET }], + config: [], + fromExisting: false, + }; +} + +describe("provider profile warnings after a binding mutation (#12940)", () => { + it("warns on post-create drift without changing a successful result", async () => { + const warn = vi.fn(); + const run = vi + .fn() + .mockReturnValueOnce(captured(0, JSON.stringify(PROFILE))) + .mockReturnValueOnce(captured(0)) + .mockReturnValueOnce(captured(0, JSON.stringify({ ...PROFILE, binaries: ["/tmp/widened"] }))); + const adapter = createCliOpenShellProviderAdapter({ + run, + warn, + readProfileFile: () => PROFILE_YAML, + }); + + expect( + adapter.importProviderProfile({ target: TARGET, profilePath: "/repo/profile.yaml" }), + ).toEqual({ ok: true }); + await expect(adapter.createProvider(createProviderRequest())).resolves.toEqual({ ok: true }); + expect(run.mock.calls.map(([args]) => args[1])).toEqual(["profile", "create", "profile"]); + expect(run.mock.calls[2]?.[0]).toEqual(PROFILE_EXPORT_ARGS); + expect(warn).toHaveBeenCalledOnce(); + expect(warn.mock.calls[0]?.[0]).toContain( + "cannot confirm which definition was used at bind time", + ); + expect(warn.mock.calls[0]?.[0]).not.toContain(SECRET); + }); + + it("does not warn when the post-create export matches the verified profile", async () => { + const warn = vi.fn(); + const run = vi + .fn() + .mockReturnValueOnce(captured(0, JSON.stringify(PROFILE))) + .mockReturnValueOnce(captured(0)) + .mockReturnValueOnce(captured(0, JSON.stringify(PROFILE))); + const adapter = createCliOpenShellProviderAdapter({ + run, + warn, + readProfileFile: () => PROFILE_YAML, + }); + + expect( + adapter.importProviderProfile({ target: TARGET, profilePath: "/repo/profile.yaml" }), + ).toEqual({ ok: true }); + await expect(adapter.createProvider(createProviderRequest())).resolves.toEqual({ ok: true }); + expect(run.mock.calls[2]?.[0]).toEqual(PROFILE_EXPORT_ARGS); + expect(warn).not.toHaveBeenCalled(); + }); + + it("warns when post-create export times out without changing a successful result", async () => { + const warn = vi.fn(); + const run = vi + .fn() + .mockReturnValueOnce(captured(0, JSON.stringify(PROFILE))) + .mockReturnValueOnce(captured(0)) + .mockReturnValueOnce( + captured(null, "", SECRET, Object.assign(new Error(), { code: "ETIMEDOUT" })), + ); + const adapter = createCliOpenShellProviderAdapter({ + run, + warn, + readProfileFile: () => PROFILE_YAML, + }); + + expect( + adapter.importProviderProfile({ target: TARGET, profilePath: "/repo/profile.yaml" }), + ).toEqual({ ok: true }); + await expect(adapter.createProvider(createProviderRequest())).resolves.toEqual({ ok: true }); + expect(warn).toHaveBeenCalledOnce(); + expect(warn.mock.calls[0]?.[0]).toContain("gateway operator"); + expect(warn.mock.calls[0]?.[0]).not.toContain(SECRET); + }); + + it("re-exports the verified profile after attach and warns on export failure", async () => { + const warn = vi.fn(); + const run = vi + .fn() + .mockReturnValueOnce(captured(0, JSON.stringify(PROFILE))) + .mockReturnValueOnce(captured(0)) + .mockReturnValueOnce( + captured( + 0, + "Name: test-provider\nType: test-profile\nCredential keys: TEST_TOKEN\nConfig keys: ", + ), + ) + .mockReturnValueOnce(captured(1, "", SECRET)); + const adapter = createCliOpenShellProviderAdapter({ + run, + warn, + readProfileFile: () => PROFILE_YAML, + }); + + expect( + adapter.importProviderProfile({ target: TARGET, profilePath: "/repo/profile.yaml" }), + ).toEqual({ ok: true }); + await expect( + adapter.attachProvider({ + target: TARGET, + sandboxName: "alpha", + providerName: "test-provider", + }), + ).resolves.toEqual({ ok: true }); + expect(run.mock.calls.map(([args]) => args[0])).toEqual([ + "provider", + "sandbox", + "provider", + "provider", + ]); + expect(run.mock.calls[3]?.[0]).toEqual(PROFILE_EXPORT_ARGS); + expect(warn).toHaveBeenCalledOnce(); + expect(warn.mock.calls[0]?.[0]).toContain("gateway operator"); + expect(warn.mock.calls[0]?.[0]).not.toContain(SECRET); + }); + + it("does not warn when an attached generic provider has no verified profile", async () => { + const warn = vi.fn(); + const run = vi + .fn() + .mockReturnValueOnce(captured(0, JSON.stringify(PROFILE))) + .mockReturnValueOnce(captured(0)) + .mockReturnValueOnce( + captured( + 0, + "Name: test-provider\nType: generic\nCredential keys: TEST_TOKEN\nConfig keys: ", + ), + ); + const adapter = createCliOpenShellProviderAdapter({ + run, + warn, + readProfileFile: () => PROFILE_YAML, + }); + + expect( + adapter.importProviderProfile({ target: TARGET, profilePath: "/repo/profile.yaml" }), + ).toEqual({ ok: true }); + await expect( + adapter.attachProvider({ + target: TARGET, + sandboxName: "alpha", + providerName: "test-provider", + }), + ).resolves.toEqual({ ok: true }); + expect(run).toHaveBeenCalledTimes(3); + expect(warn).not.toHaveBeenCalled(); + }); + + it("warns when the attached provider cannot be inspected after a verified import", async () => { + const warn = vi.fn(); + const run = vi + .fn() + .mockReturnValueOnce(captured(0, JSON.stringify(PROFILE))) + .mockReturnValueOnce(captured(0)) + .mockReturnValueOnce(captured(1, "", SECRET)); + const adapter = createCliOpenShellProviderAdapter({ + run, + warn, + readProfileFile: () => PROFILE_YAML, + }); + + expect( + adapter.importProviderProfile({ target: TARGET, profilePath: "/repo/profile.yaml" }), + ).toEqual({ ok: true }); + await expect( + adapter.attachProvider({ + target: TARGET, + sandboxName: "alpha", + providerName: "test-provider", + }), + ).resolves.toEqual({ ok: true }); + expect(run).toHaveBeenCalledTimes(3); + expect(warn).toHaveBeenCalledOnce(); + expect(warn.mock.calls[0]?.[0]).toContain("did not complete"); + expect(warn.mock.calls[0]?.[0]).not.toContain(SECRET); + }); + + it("does not inspect or warn after attaching without a prior verified profile", async () => { + const warn = vi.fn(); + const run = vi.fn().mockReturnValueOnce(captured(0)); + const adapter = createCliOpenShellProviderAdapter({ run, warn }); + + await expect( + adapter.attachProvider({ + target: TARGET, + sandboxName: "alpha", + providerName: "test-provider", + }), + ).resolves.toEqual({ ok: true }); + expect(run).toHaveBeenCalledOnce(); + expect(warn).not.toHaveBeenCalled(); + }); +}); diff --git a/src/lib/adapters/openshell/provider-adapter-cli.ts b/src/lib/adapters/openshell/provider-adapter-cli.ts index 6fb13b4f17d..b85e39aab90 100644 --- a/src/lib/adapters/openshell/provider-adapter-cli.ts +++ b/src/lib/adapters/openshell/provider-adapter-cli.ts @@ -44,6 +44,7 @@ import { parseCliOpenShellProviderMetadata, } from "./provider-metadata-cli"; import { + type CheckedInProviderProfileContract, exportedProviderProfileMatchesContract, isMissingProviderProfile, parseCheckedInProviderProfileContract, @@ -76,6 +77,7 @@ export type CliOpenShellProviderAdapterDeps = Readonly<{ defaultTimeoutMs?: number; readProfileFile?: (profilePath: string) => string; environment?: OpenShellGatewayEndpointEnvironment; + warn?: (message: string) => void; }>; export type CliOpenShellProviderAdapter = Omit & @@ -313,10 +315,13 @@ function namedGatewayEndpointOverrideError( } } -/** Register one checked-in profile through the synchronous OpenShell CLI boundary. */ -export function importCliOpenShellProviderProfile( +function importCliOpenShellProviderProfileWithCallback( request: ImportOpenShellProviderProfileRequest, - deps: CliOpenShellProviderAdapterDeps = {}, + deps: CliOpenShellProviderAdapterDeps, + onProfileVerified?: ( + target: OpenShellGatewayTarget, + contract: CheckedInProviderProfileContract, + ) => void, ): CliOpenShellProviderProfileResult { const environment = deps.environment ?? process.env; const targetError = namedGatewayEndpointOverrideError(request.target, environment); @@ -368,6 +373,7 @@ export function importCliOpenShellProviderProfile( operation: "verify", }; } + onProfileVerified?.(request.target, contract); return { ok: true }; }; @@ -402,6 +408,14 @@ export function importCliOpenShellProviderProfile( return validateExportedProfile(exportProfile()); } +/** Register one checked-in profile through the synchronous OpenShell CLI boundary. */ +export function importCliOpenShellProviderProfile( + request: ImportOpenShellProviderProfileRequest, + deps: CliOpenShellProviderAdapterDeps = {}, +): CliOpenShellProviderProfileResult { + return importCliOpenShellProviderProfileWithCallback(request, deps); +} + function parseProfileCredentialKeys(output: string, expectedProfileId: string): string[] | null { let profile: unknown; try { @@ -463,6 +477,16 @@ export function createCliOpenShellProviderAdapter( ): CliOpenShellProviderAdapter { const run = deps.run ?? runOpenshellProviderCommand; const environment = deps.environment ?? process.env; + const verifiedProfiles = new Map>(); + const targetKey = (target: OpenShellGatewayTarget) => + target.kind === "named" ? `named:${target.gatewayName}` : "selected"; + const warn = (message: string) => { + try { + (deps.warn ?? console.warn)(message); + } catch { + // Advisory output must not change a successful provider mutation. + } + }; const timeoutFor = (request: OpenShellProviderRequest) => request.timeoutMs ?? deps.defaultTimeoutMs ?? OPENSHELL_OPERATION_TIMEOUT_MS; const invoke = ( @@ -493,6 +517,34 @@ export function createCliOpenShellProviderAdapter( } }; + const warnIfVerifiedProfileChanged = (request: OpenShellProviderRequest, profileId: string) => { + const contract = verifiedProfiles.get(targetKey(request.target))?.get(profileId); + if (!contract) return; + const exported = invoke( + ["provider", "profile", "export", profileId, "--output", "json"], + { ...request, timeoutMs: Math.min(timeoutFor(request), OPENSHELL_OPERATION_TIMEOUT_MS) }, + undefined, + 2, + true, + ); + const warning = `Warning: Post-mutation verification of OpenShell provider profile '${profileId}' did not complete. Ask the gateway operator to inspect this profile.`; + if (commandError(exported)) { + warn(warning); + return; + } + try { + JSON.parse(commandStdout(exported)); + } catch { + warn(warning); + return; + } + if (!exportedProviderProfileMatchesContract(commandStdout(exported), contract)) { + warn( + `Warning: OpenShell provider profile '${profileId}' changed after verification. NemoClaw cannot confirm which definition was used at bind time. Ask the gateway operator to inspect this profile.`, + ); + } + }; + const ensureProviderPolicyComposition: OpenShellProviderAdapter["ensureProviderPolicyComposition"] = async (request) => { const targetError = namedGatewayEndpointOverrideError(request.target, environment); @@ -620,7 +672,9 @@ export function createCliOpenShellProviderAdapter( message: "OpenShell could not create the provider from existing credentials.", }); } - return error ? failure(error) : mutationSuccess(); + if (error) return failure(error); + warnIfVerifiedProfileChanged(request, request.type); + return mutationSuccess(); }; const getProvider: OpenShellProviderAdapter["getProvider"] = async ( @@ -742,7 +796,16 @@ export function createCliOpenShellProviderAdapter( }; const importProviderProfile: CliOpenShellProviderAdapter["importProviderProfile"] = (request) => { - return importCliOpenShellProviderProfile(request, { ...deps, environment, run }); + return importCliOpenShellProviderProfileWithCallback( + request, + { ...deps, environment, run }, + (target, contract) => { + const key = targetKey(target); + const profiles = verifiedProfiles.get(key) ?? new Map(); + profiles.set(contract.profileId, contract); + verifiedProfiles.set(key, profiles); + }, + ); }; const inspectProviderProfile: OpenShellProviderAdapter["inspectProviderProfile"] = async ( @@ -863,7 +926,28 @@ export function createCliOpenShellProviderAdapter( 3, ); const error = commandError(result); - return error ? failure(error) : mutationSuccess(); + if (error) return failure(error); + const profiles = verifiedProfiles.get(targetKey(request.target)); + if (profiles) { + const warnIncompleteVerification = () => + warn( + `Warning: Post-mutation profile verification for '${request.providerName}' did not complete. Ask the gateway operator to inspect its profile.`, + ); + try { + const provider = await getProvider({ + target: request.target, + providerName: request.providerName, + }); + if (!provider.ok) { + warnIncompleteVerification(); + } else if (profiles.has(provider.value.type)) { + warnIfVerifiedProfileChanged(request, provider.value.type); + } + } catch { + warnIncompleteVerification(); + } + } + return mutationSuccess(); }; const listProviderAttachments: OpenShellProviderAdapter["listProviderAttachments"] = async ( diff --git a/src/lib/messaging/applier/setup-applier.test.ts b/src/lib/messaging/applier/setup-applier.test.ts index 3763568137c..1bef4c035ce 100644 --- a/src/lib/messaging/applier/setup-applier.test.ts +++ b/src/lib/messaging/applier/setup-applier.test.ts @@ -458,6 +458,7 @@ describe("MessagingSetupApplier", () => { "--credential", "TELEGRAM_BOT_TOKEN", ], + ["provider", "profile", "export", "nemoclaw-mcp-v1", "--output", "json"], ["provider", "get", "demo-telegram-bridge"], ["provider", "update", "demo-slack-bridge", "--credential", "SLACK_BOT_TOKEN"], ["provider", "get", "demo-slack-bridge"], @@ -471,6 +472,7 @@ describe("MessagingSetupApplier", () => { "--credential", "SLACK_APP_TOKEN", ], + ["provider", "profile", "export", "nemoclaw-mcp-v1", "--output", "json"], ["provider", "get", "demo-slack-app"], ]); expect(calls[4]?.env).toEqual({ TELEGRAM_BOT_TOKEN: "123456:telegram-token" }); diff --git a/test/package-contract/cli/credentials-cli-command.test.ts b/test/package-contract/cli/credentials-cli-command.test.ts index 702a58f0802..dd02db3ade5 100644 --- a/test/package-contract/cli/credentials-cli-command.test.ts +++ b/test/package-contract/cli/credentials-cli-command.test.ts @@ -478,6 +478,17 @@ describe("credentials oclif commands", () => { timeout: 30_000, }, }, + { + args: ["provider", "profile", "-g", "nemoclaw", "export", "tavily", "--output", "json"], + opts: { + env: expect.any(Object), + ignoreError: true, + replaceEnv: true, + stdio: ["ignore", "pipe", "pipe"], + suppressOutput: true, + timeout: 30_000, + }, + }, ]); expect(calls[0]?.opts?.env?.TAVILY_API_KEY).toBeUndefined(); expect(calls[1]?.opts?.env?.UNRELATED_API_KEY).toBeUndefined();