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 @@ -109,6 +109,28 @@ describe("P0-E cloud-experimental parity guardrails", () => {
expect(result.stdout).toContain("NO_NEWLINE_IN_COMMAND");
});

it("keeps Deep Agents Tavily opt-in probe command single-line for OpenShell exec", () => {
const result = spawnSync(
"bash",
[
path.join(
process.cwd(),
"test/e2e/e2e-cloud-experimental/checks/09-deepagents-code-tavily-opt-in.sh",
),
],
{
encoding: "utf8",
env: {
NEMOCLAW_E2E_TAVILY_SELF_TEST: "probe-command-shape",
PATH: process.env.PATH ?? "/usr/bin:/bin",
},
},
);

expect(result.status).toBe(0);
expect(result.stdout).toContain("NO_NEWLINE_IN_COMMAND");
});

it("registers executable Deep Agents cloud-experimental checks", () => {
expect(DEEPAGENTS_CLOUD_EXPERIMENTAL_CHECKS).toEqual([
"test/e2e/e2e-cloud-experimental/checks/05-deepagents-code-landlock-readonly.sh",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ nemoclaw_cli() {
fi
}

python_probe() {
local url="$1"
sandbox_exec "python3 - ${url@Q} <<'PY'
python_probe_source() {
cat <<'PY'
import sys
import urllib.error
import urllib.request
Expand Down Expand Up @@ -90,12 +89,40 @@ except OSError as exc:
except Exception as exc:
print(f'ERROR:{type(exc).__name__}:{exc}')
PY
"
}

python_probe() {
local url="$1"
local encoded remote_cmd
if [ -n "${NEMOCLAW_E2E_TAVILY_PROBE_FIXTURE+x}" ]; then
printf '%s\n' "$NEMOCLAW_E2E_TAVILY_PROBE_FIXTURE"
return 0
fi
encoded="$(python_probe_source | base64 | tr -d '\n')"
remote_cmd="python3 -c \"\$(printf '%s' ${encoded@Q} | base64 -d)\" ${url@Q}"
sandbox_exec "$remote_cmd"
}

PASSED=0
FAILED=0

if [ "${NEMOCLAW_E2E_TAVILY_SELF_TEST:-}" = "probe-command-shape" ]; then
sandbox_exec() {
case "$1" in
*$'\n'*)
printf '%s\n' "NEWLINE_IN_COMMAND"
return 1
;;
*)
printf '%s\n' "NO_NEWLINE_IN_COMMAND"
return 0
;;
esac
}
python_probe "https://api.tavily.com/"
exit 0
fi

if ! sandbox_exec "test -d /sandbox/.deepagents && command -v dcode >/dev/null 2>&1" >/dev/null; then
info "SKIP: sandbox '${SANDBOX_NAME}' is not a Deep Agents Code sandbox"
exit 0
Expand Down
4 changes: 4 additions & 0 deletions test/langchain-deepagents-code-image.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,10 @@ describe("LangChain Deep Agents Code image contracts", () => {
expect(tavilyOptInCheck).toContain("policy-add tavily --dry-run");
expect(tavilyOptInCheck).toContain("policy-add tavily --yes");
expect(tavilyOptInCheck).toContain("https://api.tavily.com/");
expect(tavilyOptInCheck).toContain("python_probe_source");
expect(tavilyOptInCheck).toContain("base64 | tr -d");
expect(tavilyOptInCheck).toContain("python3 -c");
expect(tavilyOptInCheck).toContain("NEMOCLAW_E2E_TAVILY_SELF_TEST");
expect(tavilyOptInCheck).toContain("/opt/venv/");
expect(tavilyOptInCheck).toContain("managed Deep Agents Code python can reach Tavily");
expect(cloudExperimentalChecksForOnboarding("cloud-langchain-deepagents-code")).toEqual([
Expand Down
Loading