mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-06 15:18:58 +00:00
ci: fix release cross-os loader path
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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:",
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user