Skip to content

Commit 5a64e91

Browse files
committed
Revert "fix(e2e): support compatible credential migration (#5380)"
This reverts commit 9e9efd6.
1 parent 158f575 commit 5a64e91

5 files changed

Lines changed: 28 additions & 167 deletions

File tree

.github/workflows/e2e-vitest-scenarios.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -982,16 +982,11 @@ jobs:
982982

983983
- name: Run credential migration live test
984984
# Migrated from test/e2e/test-credential-migration.sh. This live test
985-
# stages NVIDIA_INFERENCE_API_KEY through legacy credentials.json as the
986-
# custom provider's COMPATIBLE_API_KEY. The hosted service behind this
987-
# repo-scoped secret is inference-api.nvidia.com, not Build/NVIDIA
988-
# Endpoints, so the test must exercise the compatible-provider route.
985+
# needs NVIDIA_INFERENCE_API_KEY only as the staged legacy credential value; it
986+
# preserves the default NVIDIA provider/key migration path while
987+
# pinning a lower-quota catalog model in the test fixture.
989988
env:
990989
NVIDIA_INFERENCE_API_KEY: ${{ secrets.NVIDIA_INFERENCE_API_KEY }}
991-
NEMOCLAW_PROVIDER: custom
992-
NEMOCLAW_ENDPOINT_URL: https://inference-api.nvidia.com/v1
993-
NEMOCLAW_MODEL: nvidia/nvidia/nemotron-3-super-v3
994-
NEMOCLAW_COMPAT_MODEL: nvidia/nvidia/nemotron-3-super-v3
995990
run: |
996991
set -euo pipefail
997992
npx vitest run --project e2e-scenarios-live \

.github/workflows/nightly-e2e.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,18 +1544,11 @@ jobs:
15441544

15451545
- name: Run credential migration Vitest test
15461546
# Trusted-code boundary: this job runs the checked-out target ref with
1547-
# NVIDIA_INFERENCE_API_KEY because it validates live credential
1548-
# migration into the OpenShell gateway. The hosted service behind this
1549-
# repo-scoped secret is inference-api.nvidia.com, not Build/NVIDIA
1550-
# Endpoints, so the test stages it as the custom provider's
1551-
# COMPATIBLE_API_KEY. Keep checkout credentials disabled, do not pass
1547+
# NVIDIA_INFERENCE_API_KEY because it validates live credential migration into the
1548+
# OpenShell gateway. Keep checkout credentials disabled, do not pass
15521549
# GITHUB_TOKEN, and rely on reviewed/maintainer-dispatched refs.
15531550
env:
15541551
NVIDIA_INFERENCE_API_KEY: ${{ secrets.NVIDIA_INFERENCE_API_KEY }}
1555-
NEMOCLAW_PROVIDER: custom
1556-
NEMOCLAW_ENDPOINT_URL: https://inference-api.nvidia.com/v1
1557-
NEMOCLAW_MODEL: nvidia/nvidia/nemotron-3-super-v3
1558-
NEMOCLAW_COMPAT_MODEL: nvidia/nvidia/nemotron-3-super-v3
15591552
E2E_ARTIFACT_DIR: ${{ github.workspace }}/e2e-artifacts/vitest/credential-migration
15601553
NEMOCLAW_RUN_E2E_SCENARIOS: "1"
15611554
NEMOCLAW_SANDBOX_NAME: "e2e-cred-migration"

test/e2e-scenario/fixtures/hosted-inference.ts

Lines changed: 0 additions & 60 deletions
This file was deleted.

test/e2e-scenario/live/credential-migration.test.ts

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { buildAvailabilityProbeEnv } from "../fixtures/availability-env.ts";
99
import type { HostCliClient } from "../fixtures/clients/host.ts";
1010
import { validateSandboxName } from "../fixtures/clients/sandbox.ts";
1111
import { expect, test } from "../fixtures/e2e-test.ts";
12-
import { requireHostedInferenceConfig } from "../fixtures/hosted-inference.ts";
1312
import { shouldRunLiveE2EScenarios } from "../fixtures/live-project-gate.ts";
1413

1514
// Migrated from test/e2e/test-credential-migration.sh. This is a focused live
@@ -18,10 +17,10 @@ import { shouldRunLiveE2EScenarios } from "../fixtures/live-project-gate.ts";
1817
// a successful real onboard registers the migrated value with the OpenShell
1918
// gateway, the plaintext file is removed after success, credentials list reads
2019
// from the gateway, and secure unlink removes a planted symlink without touching
21-
// its target. The repository secret is named NVIDIA_INFERENCE_API_KEY, but the
22-
// hosted E2E service is the OpenAI-compatible inference-api.nvidia.com endpoint,
23-
// so the migration contract stages that value as COMPATIBLE_API_KEY and expects
24-
// the compatible-endpoint gateway provider.
20+
// its target. The live onboard intentionally follows the legacy default NVIDIA
21+
// Endpoints path: NVIDIA_INFERENCE_API_KEY is present only in the legacy file, absent from
22+
// the onboard child env, and must migrate into the nvidia-prod gateway provider.
23+
// No registry, migration ledger, or shared helper is introduced.
2524

2625
const REPO_ROOT = path.resolve(import.meta.dirname, "../../..");
2726
const CLI_ENTRYPOINT = path.join(REPO_ROOT, "bin", "nemoclaw.js");
@@ -108,10 +107,7 @@ async function cleanupCredentialMigrationState(host: HostCliClient, home: string
108107
host.command("node", [CLI_ENTRYPOINT, SANDBOX_NAME, "destroy", "--yes"], {
109108
artifactName: "cleanup-nemoclaw-destroy",
110109
env,
111-
redactionValues: [
112-
process.env.NVIDIA_INFERENCE_API_KEY ?? "",
113-
process.env.COMPATIBLE_API_KEY ?? "",
114-
],
110+
redactionValues: [process.env.NVIDIA_INFERENCE_API_KEY ?? ""],
115111
timeoutMs: 120_000,
116112
}),
117113
);
@@ -142,18 +138,15 @@ runCredentialMigrationTest(
142138
"credential migration stages legacy file into gateway and removes plaintext safely",
143139
{ timeout: ONBOARD_TIMEOUT_MS + INSTALL_TIMEOUT_MS + 5 * 60_000 },
144140
async ({ artifacts, cleanup, host, secrets, skip }) => {
145-
// Use the existing nightly secret as the legacy provider credential. The
146-
// onboard child env below deliberately does not receive that credential, so
141+
// Use the existing nightly secret as the legacy NVIDIA credential. The
142+
// onboard child env below deliberately does not receive NVIDIA_INFERENCE_API_KEY, so
147143
// the only source is ~/.nemoclaw/credentials.json — matching the retired
148144
// shell lane's migration contract.
149-
const hostedInference = requireHostedInferenceConfig(secrets, process.env, {
150-
model: CREDENTIAL_MIGRATION_MODEL,
151-
});
152-
const migratedCredentialValue = hostedInference.apiKey;
153-
const {
154-
[hostedInference.credentialEnv]: _omittedCredential,
155-
...hostedInferenceEnvWithoutCredential
156-
} = hostedInference.env;
145+
const migratedCredentialValue = secrets.required("NVIDIA_INFERENCE_API_KEY");
146+
expect(
147+
migratedCredentialValue.startsWith("nvapi-"),
148+
"NVIDIA_INFERENCE_API_KEY must start with nvapi-",
149+
).toBe(true);
157150
expect(fs.existsSync(CLI_ENTRYPOINT), "bin/nemoclaw.js missing").toBe(true);
158151
expect(
159152
fs.existsSync(DIST_CREDENTIAL_STORE),
@@ -190,9 +183,8 @@ runCredentialMigrationTest(
190183
sandboxName: SANDBOX_NAME,
191184
contracts: [
192185
"legacy credentials.json stages allowlisted provider keys into onboard env",
193-
`successful onboard registers the migrated value with the ${hostedInference.providerName} OpenShell gateway provider`,
194-
`${hostedInference.sourceSecretName} is migrated into the ${hostedInference.credentialEnv} provider credential`,
195-
`onboard uses the ${hostedInference.provider} provider and ${hostedInference.endpointUrl} endpoint path`,
186+
"successful default NVIDIA Endpoints onboard registers the migrated value with OpenShell gateway",
187+
"onboard keeps the default NVIDIA provider/key/endpoint/policy path while pinning a low-quota catalog model",
196188
"successful onboard removes plaintext credentials.json",
197189
"tampered non-credential keys do not become gateway providers",
198190
"credentials list reads providers from the gateway, not disk",
@@ -209,7 +201,7 @@ runCredentialMigrationTest(
209201
legacyFile,
210202
JSON.stringify(
211203
{
212-
[hostedInference.credentialEnv]: migratedCredentialValue,
204+
NVIDIA_INFERENCE_API_KEY: migratedCredentialValue,
213205
OPENSHELL_GATEWAY: "evil-gw-from-tampered-file",
214206
NODE_OPTIONS: "--require=/tmp/evil.js",
215207
},
@@ -222,9 +214,11 @@ runCredentialMigrationTest(
222214
const onboard = await host.command("node", [CLI_ENTRYPOINT, "onboard", "--non-interactive"], {
223215
artifactName: "onboard-from-legacy-credentials",
224216
env: testEnv(home, {
225-
...hostedInferenceEnvWithoutCredential,
226217
NEMOCLAW_SANDBOX_NAME: SANDBOX_NAME,
227218
NEMOCLAW_RECREATE_SANDBOX: "1",
219+
// Keep the default NVIDIA provider/key/endpoint/policy path while
220+
// avoiding the high-quota default Nemotron validation model.
221+
NEMOCLAW_MODEL: CREDENTIAL_MIGRATION_MODEL,
228222
}),
229223
redactionValues: [migratedCredentialValue],
230224
timeoutMs: ONBOARD_TIMEOUT_MS,
@@ -253,10 +247,9 @@ runCredentialMigrationTest(
253247
.split(/\r?\n/)
254248
.map((line) => line.trim())
255249
.filter((line) => /^[a-zA-Z][a-zA-Z0-9_-]*$/.test(line));
256-
expect(
257-
providerNames,
258-
`expected migrated ${hostedInference.providerName} provider\n${providersText}`,
259-
).toContain(hostedInference.providerName);
250+
expect(providerNames, `expected migrated NVIDIA provider\n${providersText}`).toContain(
251+
"nvidia-prod",
252+
);
260253
expect(providerNames).not.toContain("OPENSHELL_GATEWAY");
261254
expect(providerNames).not.toContain("NODE_OPTIONS");
262255

@@ -299,17 +292,15 @@ runCredentialMigrationTest(
299292
await artifacts.writeJson("scenario-result.json", {
300293
id: "credential-migration",
301294
sandboxName: SANDBOX_NAME,
302-
model: hostedInference.model || CREDENTIAL_MIGRATION_MODEL,
303-
provider: hostedInference.providerName,
304-
credentialEnv: hostedInference.credentialEnv,
295+
model: CREDENTIAL_MIGRATION_MODEL,
305296
providerNames,
306297
assertions: {
307298
onboardSucceeded: onboard.exitCode === 0,
308299
migrationNoticeEmitted: onboardText.includes(
309300
"Staged 1 legacy credential(s) for migration to the OpenShell gateway.",
310301
),
311302
legacyFileRemovedAfterOnboard: !fs.existsSync(legacyFile),
312-
migratedProviderRegistered: providerNames.includes(hostedInference.providerName),
303+
migratedNvidiaProviderRegistered: providerNames.includes("nvidia-prod"),
313304
tamperedKeysExcluded:
314305
!providerNames.includes("OPENSHELL_GATEWAY") && !providerNames.includes("NODE_OPTIONS"),
315306
credentialsListReadsGateway: credentialsText.includes(

test/e2e-scenario/support-tests/hosted-inference.test.ts

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)