diff --git a/test/e2e/e2e-cloud-experimental/checks/04-deepagents-code-fresh-reonboard.sh b/test/e2e/e2e-cloud-experimental/checks/04-deepagents-code-fresh-reonboard.sh index e85cfdc2a8..d05d2b0dde 100755 --- a/test/e2e/e2e-cloud-experimental/checks/04-deepagents-code-fresh-reonboard.sh +++ b/test/e2e/e2e-cloud-experimental/checks/04-deepagents-code-fresh-reonboard.sh @@ -33,7 +33,11 @@ sandbox_exec() { } dcode_identity() { - openshell sandbox exec --name "$SANDBOX_NAME" -- dcode identity 2>&1 + # Invoke dcode by absolute path: `openshell sandbox exec -- dcode ...` runs + # without a login shell, so /usr/local/bin is not on PATH and a bare `dcode` + # resolves to "command not found". The image installs the launcher at + # /usr/local/bin/dcode (see agents/langchain-deepagents-code/Dockerfile). + openshell sandbox exec --name "$SANDBOX_NAME" -- /usr/local/bin/dcode identity 2>&1 } identity_field() { @@ -148,7 +152,13 @@ fi [ -n "${COMPATIBLE_API_KEY:-}" ] || fail "COMPATIBLE_API_KEY is required" [ -x "$CLI" ] || fail "NemoClaw CLI is not executable at $CLI" -identity_before="$(dcode_identity)" || fail "could not read initial dcode identity" +if ! identity_before="$(dcode_identity)"; then + # Surface the captured stdout+stderr (dcode_identity redirects 2>&1) before + # failing. Without this the real reason `dcode identity` exits non-zero is + # discarded and CI/result.json only show the generic message with stdout "". + printf '%s: diagnostic: initial dcode identity output:\n%s\n' "$PREFIX" "${identity_before:-}" + fail "could not read initial dcode identity" +fi model_a="$(identity_field "$identity_before" Model)" model_a="${model_a#openai:}" [ -n "$model_a" ] || fail "initial dcode identity did not report a model" @@ -193,7 +203,10 @@ pass "same-name --fresh re-onboard crossed backup and restore boundaries" sandbox_list="$(openshell sandbox list 2>&1)" || fail "could not list sandbox after re-onboard" printf '%s\n' "$sandbox_list" | awk -v name="$SANDBOX_NAME" '$1 == name && /Ready/ { found = 1 } END { exit(found ? 0 : 1) }' || fail "same-name sandbox is not Ready after re-onboard" -identity_after="$(dcode_identity)" || fail "could not read dcode identity after re-onboard" +if ! identity_after="$(dcode_identity)"; then + printf '%s: diagnostic: dcode identity output after re-onboard:\n%s\n' "$PREFIX" "${identity_after:-}" + fail "could not read dcode identity after re-onboard" +fi assert_identity "$identity_after" "$model_b" "fresh" printf '%s\n' "$identity_after" | grep -Fq "$model_a" && fail "fresh identity still contains model A" pass "live dcode identity reports model B" diff --git a/vitest.config.ts b/vitest.config.ts index 89a564153f..5cbe8c26a6 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -140,6 +140,13 @@ export default defineConfig({ test: { name: "e2e-live", alias: canonicalOpenShellPolicyAlias, + // Register the typed-source require hook in the worker so live suites + // can import source modules that resolve siblings via a runtime + // `require("../module")` (e.g. inference/ollama-runtime-context.ts). + // Use setupFiles rather than NODE_OPTIONS so the hook stays in-process + // and never leaks `--require` into the real CLI subprocesses under + // test. Mirrors the `cli` project. + setupFiles: ["test/helpers/onboard-script-mocks.cjs"], testTimeout: testTimeout(LIVE_E2E_PROJECT_TIMEOUT_MS), // Live targets mutate host, Docker, gateway, and sandbox state. A // whole-test retry reuses that state and can hide the first failure