Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(test-modules): stop staging on a failed download or digest check

M3gA-Mindadb8f2383454
diff --git a/scripts/modules/stage-local-modules.sh b/scripts/modules/stage-local-modules.sh
index 44b8fa319f..cce4fd6c1a 100644
--- a/scripts/modules/stage-local-modules.sh
+++ b/scripts/modules/stage-local-modules.sh
@@ -25,11 +25,13 @@ stage_release_module() {
if ! compgen -G "$dir/*.$ext" >/dev/null; then
echo "Downloading the checksum-pinned ${id} test module ..." >&2
mkdir -p "$dir"
- curl --fail --location --silent --show-error "$url" --output "$archive"
+ # Callers run this in $(...), where errexit does not apply: a failed
+ # download or digest check must stop here, never fall through to tar.
+ curl --fail --location --silent --show-error "$url" --output "$archive" || return 1
if command -v shasum >/dev/null 2>&1; then
- echo "${sha} $archive" | shasum -a 256 -c >&2
+ echo "${sha} $archive" | shasum -a 256 -c >&2 || { rm -f "$archive"; return 1; }
else
- echo "${sha} $archive" | sha256sum --check >&2
+ echo "${sha} $archive" | sha256sum --check >&2 || { rm -f "$archive"; return 1; }
fi
tar --no-same-owner -xzf "$archive" -C "$dir"
fi
@@ -41,7 +43,7 @@ stage_release_module() {
# OPENHUMAN_MODULE_PATH.
stage_release_artifact() {
local id="$1" dir
- dir="$(stage_release_module "$id" "$2" "$3")"
+ dir="$(stage_release_module "$id" "$2" "$3")" || return 1
if [ "$3" = "dll" ]; then
printf '%s\n' "$dir/${id}_module.dll"
else
diff --git a/scripts/test-rust-with-mock.sh b/scripts/test-rust-with-mock.sh
index cb27860ec3..c66a6af9f1 100755
--- a/scripts/test-rust-with-mock.sh
+++ b/scripts/test-rust-with-mock.sh
@@ -186,8 +186,10 @@ export OPENHUMAN_CHANNELS_TEST_ARTIFACT="$tinychannels_artifact"
# The native Telegram voice-note E2E loads the released TinyVoice by file, as
# the CI installer exports it. It stays off OPENHUMAN_MODULE_PATH so no other
# suite starts loading it.
-OPENHUMAN_VOICE_TEST_ARTIFACT="$(stage_release_artifact tinyvoice "$wallet_platform" "$module_ext")"
-export OPENHUMAN_VOICE_TEST_ARTIFACT
+if [ -z "${OPENHUMAN_VOICE_TEST_ARTIFACT:-}" ]; then
+ OPENHUMAN_VOICE_TEST_ARTIFACT="$(stage_release_artifact tinyvoice "$wallet_platform" "$module_ext")"
+ export OPENHUMAN_VOICE_TEST_ARTIFACT
+fi
# The MCP registry E2E targets exercise real TinyMCP lifecycle calls through
# the host's module adapter, so they load the released, checksum-pinned module
diff --git a/tests/native_channel_session_restart_e2e.rs b/tests/native_channel_session_restart_e2e.rs
index 16ae57c49b..e3eba3ccc0 100644
--- a/tests/native_channel_session_restart_e2e.rs
+++ b/tests/native_channel_session_restart_e2e.rs
@@ -458,6 +458,9 @@ fn test_modules(voice: bool) -> TestModules {
OPENHUMAN_TEST_MODULE_SOURCE_DIR to scripts/modules/build.mjs output"
)
});
+ // The child runs from its own home, so a relative path must not reach it.
+ let path = std::fs::canonicalize(&path)
+ .unwrap_or_else(|error| panic!("{var}={}: {error}", path.display()));
assert!(path.is_file(), "{var} names no file: {}", path.display());
(id, path)
})