ci: fix release cross-os loader path · openclaw/openclaw@cc9f88e
steipete
·
2026-05-06
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,9 +17,15 @@ fi
|
17 | 17 | |
18 | 18 | node_cmd="node" |
19 | 19 | npm_cmd="npm" |
| 20 | +npm_cli_js="" |
20 | 21 | if command -v cygpath >/dev/null 2>&1; then |
21 | 22 | if command -v node.exe >/dev/null 2>&1; then |
22 | 23 | node_cmd="node.exe" |
| 24 | + node_path="$(command -v node.exe)" |
| 25 | + node_dir="$(dirname "$(cygpath -u "${node_path}")")" |
| 26 | +if [[ -f "${node_dir}/node_modules/npm/bin/npm-cli.js" ]]; then |
| 27 | + npm_cli_js="${node_dir}/node_modules/npm/bin/npm-cli.js" |
| 28 | +fi |
23 | 29 | fi |
24 | 30 | if command -v npm.cmd >/dev/null 2>&1; then |
25 | 31 | npm_cmd="npm.cmd" |
@@ -51,10 +57,9 @@ command -v "${npm_cmd}" >/dev/null 2>&1 || {
|
51 | 57 | |
52 | 58 | if [[ ! -f "${loader_path}" ]]; then |
53 | 59 | mkdir -p "${tool_dir}" |
54 | | -if command -v cygpath >/dev/null 2>&1 && [[ "${npm_cmd}" == *.cmd ]]; then |
55 | | - npm_install_cmd="\"${npm_cmd}\" install --prefix \"${npm_tool_dir}\" --no-save --no-package-lock \"tsx@${tsx_version}\"" |
56 | | -if ! cmd.exe /d /s /c "${npm_install_cmd}" >/dev/null; then |
57 | | -echo "failed to install cross-OS release-check loader with ${npm_cmd}." >&2 |
| 60 | +if [[ -n "${npm_cli_js}" ]]; then |
| 61 | +if ! "${node_cmd}" "${npm_cli_js}" install --prefix "${tool_dir}" --no-save --no-package-lock "tsx@${tsx_version}" >/dev/null; then |
| 62 | +echo "failed to install cross-OS release-check loader with ${node_cmd} ${npm_cli_js}." >&2 |
58 | 63 | exit 127 |
59 | 64 | fi |
60 | 65 | 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
|
63 | 68 | fi |
64 | 69 | fi |
65 | 70 | |
| 71 | +if [[ ! -f "${loader_path}" ]]; then |
| 72 | +echo "tsx loader missing after install: ${loader_path}" >&2 |
| 73 | + find "${tool_dir}" -maxdepth 5 -type f 2>/dev/null | sort | sed 's/^/ /' >&2 || true |
| 74 | +exit 127 |
| 75 | +fi |
| 76 | + |
66 | 77 | loader_url="$( |
67 | 78 | "${node_cmd}" -e ' |
68 | 79 | const { resolve } = require("node:path"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -68,6 +68,13 @@ describe("gateway codex harness live helpers", () => {
|
68 | 68 | expect(isExpectedCodexStatusCommandText(text)).toBe(true); |
69 | 69 | }); |
70 | 70 | |
| 71 | +it("accepts natural running-session status prose with the session id", () => { |
| 72 | +const text = |
| 73 | +"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`."; |
| 74 | + |
| 75 | +expect(isExpectedCodexStatusCommandText(text)).toBe(true); |
| 76 | +}); |
| 77 | + |
71 | 78 | it("accepts the current status card emitted by OpenAI Codex", () => { |
72 | 79 | const text = [ |
73 | 80 | "Current session status:", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -126,9 +126,11 @@ export function isExpectedCodexStatusCommandText(text: string): boolean {
|
126 | 126 | mentionsModel; |
127 | 127 | const isRunningSessionStatus = |
128 | 128 | normalized.includes("session is running on") && |
129 | | -normalized.includes("context used") && |
130 | | -normalized.includes("cache hit") && |
| 129 | +(normalized.includes("context used") || |
| 130 | +normalized.includes("context is about") || |
| 131 | +normalized.includes("context is at")) && |
131 | 132 | normalized.includes("no compactions") && |
| 133 | +(normalized.includes("current session is") || normalized.includes("cache hit")) && |
132 | 134 | mentionsModel; |
133 | 135 | |
134 | 136 | return ( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。