Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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:-<no output captured>}"
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"
Expand Down Expand Up @@ -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:-<no output captured>}"
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"
Expand Down
7 changes: 7 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading