From cc9f88e6e62a586dc670ff1bfda7e1dcf1e8d0f7 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 6 May 2026 12:20:38 +0100 Subject: [PATCH] ci: fix release cross-os loader path --- .../run-openclaw-cross-os-release-checks.sh | 19 +++++++++++++++---- ...gateway-codex-harness.live-helpers.test.ts | 7 +++++++ .../gateway-codex-harness.live-helpers.ts | 6 ++++-- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/scripts/github/run-openclaw-cross-os-release-checks.sh b/scripts/github/run-openclaw-cross-os-release-checks.sh index 448a65223fc..3be9081b2db 100755 --- a/scripts/github/run-openclaw-cross-os-release-checks.sh +++ b/scripts/github/run-openclaw-cross-os-release-checks.sh @@ -17,9 +17,15 @@ fi node_cmd="node" npm_cmd="npm" +npm_cli_js="" if command -v cygpath >/dev/null 2>&1; then if command -v node.exe >/dev/null 2>&1; then node_cmd="node.exe" + node_path="$(command -v node.exe)" + node_dir="$(dirname "$(cygpath -u "${node_path}")")" + if [[ -f "${node_dir}/node_modules/npm/bin/npm-cli.js" ]]; then + npm_cli_js="${node_dir}/node_modules/npm/bin/npm-cli.js" + fi fi if command -v npm.cmd >/dev/null 2>&1; then npm_cmd="npm.cmd" @@ -51,10 +57,9 @@ command -v "${npm_cmd}" >/dev/null 2>&1 || { if [[ ! -f "${loader_path}" ]]; then mkdir -p "${tool_dir}" - if command -v cygpath >/dev/null 2>&1 && [[ "${npm_cmd}" == *.cmd ]]; then - npm_install_cmd="\"${npm_cmd}\" install --prefix \"${npm_tool_dir}\" --no-save --no-package-lock \"tsx@${tsx_version}\"" - if ! cmd.exe /d /s /c "${npm_install_cmd}" >/dev/null; then - echo "failed to install cross-OS release-check loader with ${npm_cmd}." >&2 + if [[ -n "${npm_cli_js}" ]]; then + if ! "${node_cmd}" "${npm_cli_js}" install --prefix "${tool_dir}" --no-save --no-package-lock "tsx@${tsx_version}" >/dev/null; then + echo "failed to install cross-OS release-check loader with ${node_cmd} ${npm_cli_js}." >&2 exit 127 fi elif ! "${npm_cmd}" install --prefix "${npm_tool_dir}" --no-save --no-package-lock "tsx@${tsx_version}" >/dev/null; then @@ -63,6 +68,12 @@ if [[ ! -f "${loader_path}" ]]; then fi fi +if [[ ! -f "${loader_path}" ]]; then + echo "tsx loader missing after install: ${loader_path}" >&2 + find "${tool_dir}" -maxdepth 5 -type f 2>/dev/null | sort | sed 's/^/ /' >&2 || true + exit 127 +fi + loader_url="$( "${node_cmd}" -e ' const { resolve } = require("node:path"); diff --git a/src/gateway/gateway-codex-harness.live-helpers.test.ts b/src/gateway/gateway-codex-harness.live-helpers.test.ts index 7eb04f0a298..54bc7409083 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.test.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.test.ts @@ -68,6 +68,13 @@ describe("gateway codex harness live helpers", () => { expect(isExpectedCodexStatusCommandText(text)).toBe(true); }); + it("accepts natural running-session status prose with the session id", () => { + const text = + "Session is running on `codex/gpt-5.5` with low thinking. Context is about 9% used, no compactions, and the current session is `agent:dev:live-codex-harness`."; + + expect(isExpectedCodexStatusCommandText(text)).toBe(true); + }); + it("accepts the current status card emitted by OpenAI Codex", () => { const text = [ "Current session status:", diff --git a/src/gateway/gateway-codex-harness.live-helpers.ts b/src/gateway/gateway-codex-harness.live-helpers.ts index c1cbd97c452..5a167d5ff8b 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.ts @@ -126,9 +126,11 @@ export function isExpectedCodexStatusCommandText(text: string): boolean { mentionsModel; const isRunningSessionStatus = normalized.includes("session is running on") && - normalized.includes("context used") && - normalized.includes("cache hit") && + (normalized.includes("context used") || + normalized.includes("context is about") || + normalized.includes("context is at")) && normalized.includes("no compactions") && + (normalized.includes("current session is") || normalized.includes("cache hit")) && mentionsModel; return (