From db09dbcb0c04f0b80a6e72e082e666724364fd0c Mon Sep 17 00:00:00 2001 From: Taylor Mutch Date: Wed, 21 Oct 2026 12:18:38 -0700 Subject: [PATCH 1/2] fix(examples): repair multi-agent notepad launch Signed-off-by: Taylor Mutch --- examples/multi-agent-notepad/demo.sh | 3 + tasks/scripts/test-multi-agent-notepad.sh | 96 +++++++++++++++++++++++ tasks/test.toml | 7 ++ 3 files changed, 106 insertions(+) create mode 100755 tasks/scripts/test-multi-agent-notepad.sh diff --git a/examples/multi-agent-notepad/demo.sh b/examples/multi-agent-notepad/demo.sh index 53535a644d..1e0acfbcab 100755 --- a/examples/multi-agent-notepad/demo.sh +++ b/examples/multi-agent-notepad/demo.sh @@ -166,6 +166,9 @@ run_sandbox() { --provider "$DEMO_GITHUB_PROVIDER_NAME" \ --policy "$POLICY_FILE" \ --upload "${PAYLOAD_DIR}:/sandbox" \ + --detach \ + --no-tty + "$OPENSHELL_BIN" sandbox exec "$name" \ --no-tty \ -- bash /sandbox/payload/demo-runner.sh "$@" } diff --git a/tasks/scripts/test-multi-agent-notepad.sh b/tasks/scripts/test-multi-agent-notepad.sh new file mode 100755 index 0000000000..6b343ed7fc --- /dev/null +++ b/tasks/scripts/test-multi-agent-notepad.sh @@ -0,0 +1,96 @@ +#!/usr/bin/env bash +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +tmpdir="$(mktemp -d)" +trap 'rm -rf "$tmpdir"' EXIT + +home_dir="${tmpdir}/home" +fake_openshell="${tmpdir}/openshell" +call_log="${tmpdir}/openshell-calls" +mkdir -p "${home_dir}/.codex" + +cat >"${home_dir}/.codex/auth.json" <<'EOF' +{ + "tokens": { + "access_token": "test-access-token", + "refresh_token": "test-refresh-token", + "account_id": "test-account-id" + } +} +EOF + +cat >"$fake_openshell" <<'EOF' +#!/usr/bin/env bash +set -euo pipefail + +printf '%q' "$1" >>"$OPENSHELL_TEST_CALL_LOG" +shift +for arg in "$@"; do + printf ' %q' "$arg" >>"$OPENSHELL_TEST_CALL_LOG" +done +printf '\n' >>"$OPENSHELL_TEST_CALL_LOG" +EOF +chmod +x "$fake_openshell" + +HOME="$home_dir" \ +OPENSHELL_BIN="$fake_openshell" \ +OPENSHELL_TEST_CALL_LOG="$call_log" \ +DEMO_GITHUB_OWNER="example-owner" \ +DEMO_GITHUB_REPO="example-repo" \ +DEMO_GITHUB_TOKEN="test-github-token" \ +DEMO_AGENT_IMAGE="example.invalid/codex-agent:test" \ +DEMO_AGENT_COUNT=1 \ +DEMO_RUN_ID="test-run" \ +bash "${ROOT}/examples/multi-agent-notepad/demo.sh" >"${tmpdir}/demo.out" + +create_count="$(grep -c '^sandbox create ' "$call_log")" +exec_count="$(grep -c '^sandbox exec ' "$call_log")" + +if [ "$create_count" -ne 2 ]; then + echo "FAIL: expected worker and synthesis sandbox create calls" >&2 + cat "$call_log" >&2 + exit 1 +fi + +if [ "$exec_count" -ne 2 ]; then + echo "FAIL: expected worker and synthesis sandbox exec calls" >&2 + cat "$call_log" >&2 + exit 1 +fi + +while IFS= read -r call; do + if [[ "$call" != *" --upload "* ]]; then + echo "FAIL: sandbox create must upload the demo payload" >&2 + echo "$call" >&2 + exit 1 + fi + if [[ "$call" != *" --detach "* ]]; then + echo "FAIL: sandbox create must detach before the demo command runs" >&2 + echo "$call" >&2 + exit 1 + fi + if [[ "$call" == *" demo-runner.sh"* ]]; then + echo "FAIL: sandbox create must not include the demo command" >&2 + echo "$call" >&2 + exit 1 + fi +done < <(grep '^sandbox create ' "$call_log") + +while IFS= read -r call; do + if [[ "$call" != *" --no-tty -- bash /sandbox/payload/demo-runner.sh "* ]]; then + echo "FAIL: sandbox exec must run the uploaded demo payload" >&2 + echo "$call" >&2 + exit 1 + fi + if [[ "$call" == *" --upload "* ]]; then + echo "FAIL: sandbox exec must not include upload arguments" >&2 + echo "$call" >&2 + exit 1 + fi +done < <(grep '^sandbox exec ' "$call_log") + +echo "Multi-agent notepad demo tests passed." diff --git a/tasks/test.toml b/tasks/test.toml index 95e049d9ab..f23e279d41 100644 --- a/tasks/test.toml +++ b/tasks/test.toml @@ -15,6 +15,7 @@ depends = [ "test:postgres-runner", "test:gateway-pull-policy", "test:e2e-image-overrides", + "test:multi-agent-notepad", "test:gateway-config", "test:packaging-assets", "test:qualification-summary", @@ -64,6 +65,12 @@ run = "tasks/scripts/test-e2e-image-overrides.sh" run_windows = "echo Skipping test:e2e-image-overrides: Unix E2E wrappers do not apply on Windows." hide = true +["test:multi-agent-notepad"] +description = "Test the multi-agent notepad demo orchestration" +run = "tasks/scripts/test-multi-agent-notepad.sh" +run_windows = "echo Skipping test:multi-agent-notepad: the demo is a Bash script." +hide = true + ["test:packaging-assets"] description = "Run static packaging asset tests" run = "tasks/scripts/test-packaging-assets.sh" From 68375dfc7aaeb973a8b44d3352303d56aec84555 Mon Sep 17 00:00:00 2001 From: Taylor Mutch Date: Wed, 21 Oct 2026 12:22:03 -0700 Subject: [PATCH 2/2] test(examples): remove redundant demo harness Signed-off-by: Taylor Mutch --- tasks/scripts/test-multi-agent-notepad.sh | 96 ----------------------- tasks/test.toml | 7 -- 2 files changed, 103 deletions(-) delete mode 100755 tasks/scripts/test-multi-agent-notepad.sh diff --git a/tasks/scripts/test-multi-agent-notepad.sh b/tasks/scripts/test-multi-agent-notepad.sh deleted file mode 100755 index 6b343ed7fc..0000000000 --- a/tasks/scripts/test-multi-agent-notepad.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env bash -# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -euo pipefail - -ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" -tmpdir="$(mktemp -d)" -trap 'rm -rf "$tmpdir"' EXIT - -home_dir="${tmpdir}/home" -fake_openshell="${tmpdir}/openshell" -call_log="${tmpdir}/openshell-calls" -mkdir -p "${home_dir}/.codex" - -cat >"${home_dir}/.codex/auth.json" <<'EOF' -{ - "tokens": { - "access_token": "test-access-token", - "refresh_token": "test-refresh-token", - "account_id": "test-account-id" - } -} -EOF - -cat >"$fake_openshell" <<'EOF' -#!/usr/bin/env bash -set -euo pipefail - -printf '%q' "$1" >>"$OPENSHELL_TEST_CALL_LOG" -shift -for arg in "$@"; do - printf ' %q' "$arg" >>"$OPENSHELL_TEST_CALL_LOG" -done -printf '\n' >>"$OPENSHELL_TEST_CALL_LOG" -EOF -chmod +x "$fake_openshell" - -HOME="$home_dir" \ -OPENSHELL_BIN="$fake_openshell" \ -OPENSHELL_TEST_CALL_LOG="$call_log" \ -DEMO_GITHUB_OWNER="example-owner" \ -DEMO_GITHUB_REPO="example-repo" \ -DEMO_GITHUB_TOKEN="test-github-token" \ -DEMO_AGENT_IMAGE="example.invalid/codex-agent:test" \ -DEMO_AGENT_COUNT=1 \ -DEMO_RUN_ID="test-run" \ -bash "${ROOT}/examples/multi-agent-notepad/demo.sh" >"${tmpdir}/demo.out" - -create_count="$(grep -c '^sandbox create ' "$call_log")" -exec_count="$(grep -c '^sandbox exec ' "$call_log")" - -if [ "$create_count" -ne 2 ]; then - echo "FAIL: expected worker and synthesis sandbox create calls" >&2 - cat "$call_log" >&2 - exit 1 -fi - -if [ "$exec_count" -ne 2 ]; then - echo "FAIL: expected worker and synthesis sandbox exec calls" >&2 - cat "$call_log" >&2 - exit 1 -fi - -while IFS= read -r call; do - if [[ "$call" != *" --upload "* ]]; then - echo "FAIL: sandbox create must upload the demo payload" >&2 - echo "$call" >&2 - exit 1 - fi - if [[ "$call" != *" --detach "* ]]; then - echo "FAIL: sandbox create must detach before the demo command runs" >&2 - echo "$call" >&2 - exit 1 - fi - if [[ "$call" == *" demo-runner.sh"* ]]; then - echo "FAIL: sandbox create must not include the demo command" >&2 - echo "$call" >&2 - exit 1 - fi -done < <(grep '^sandbox create ' "$call_log") - -while IFS= read -r call; do - if [[ "$call" != *" --no-tty -- bash /sandbox/payload/demo-runner.sh "* ]]; then - echo "FAIL: sandbox exec must run the uploaded demo payload" >&2 - echo "$call" >&2 - exit 1 - fi - if [[ "$call" == *" --upload "* ]]; then - echo "FAIL: sandbox exec must not include upload arguments" >&2 - echo "$call" >&2 - exit 1 - fi -done < <(grep '^sandbox exec ' "$call_log") - -echo "Multi-agent notepad demo tests passed." diff --git a/tasks/test.toml b/tasks/test.toml index f23e279d41..95e049d9ab 100644 --- a/tasks/test.toml +++ b/tasks/test.toml @@ -15,7 +15,6 @@ depends = [ "test:postgres-runner", "test:gateway-pull-policy", "test:e2e-image-overrides", - "test:multi-agent-notepad", "test:gateway-config", "test:packaging-assets", "test:qualification-summary", @@ -65,12 +64,6 @@ run = "tasks/scripts/test-e2e-image-overrides.sh" run_windows = "echo Skipping test:e2e-image-overrides: Unix E2E wrappers do not apply on Windows." hide = true -["test:multi-agent-notepad"] -description = "Test the multi-agent notepad demo orchestration" -run = "tasks/scripts/test-multi-agent-notepad.sh" -run_windows = "echo Skipping test:multi-agent-notepad: the demo is a Bash script." -hide = true - ["test:packaging-assets"] description = "Run static packaging asset tests" run = "tasks/scripts/test-packaging-assets.sh"