From 1a72ddc1bdce1674ce2a5d93a383f35c26e084da Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 27 Mar 2026 16:13:59 +0000 Subject: [PATCH 1/2] fix: disinto init: project TOML uses localhost forge_url, breaks agents container (#782) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When DISINTO_CONTAINER=1, load-project.sh now skips overriding env vars that are already set by docker-compose (FORGE_URL, PROJECT_REPO_ROOT, OPS_REPO_ROOT, etc.). This prevents the TOML's host-perspective values (localhost, /home/johba/…) from clobbering the correct container values (forgejo:3000, /home/agent/…). Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/load-project.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/load-project.sh b/lib/load-project.sh index 0ef6301..dcddc94 100755 --- a/lib/load-project.sh +++ b/lib/load-project.sh @@ -80,9 +80,17 @@ if mirrors: return 1 2>/dev/null || exit 1 } -# Export parsed variables +# Export parsed variables. +# Inside the agents container (DISINTO_CONTAINER=1), compose already sets the +# correct FORGE_URL (http://forgejo:3000) and path vars for the container +# environment. The TOML carries host-perspective values (localhost, /home/johba/…) +# that would break container API calls and path resolution. Skip overriding +# any env var that is already set when running inside the container. while IFS='=' read -r _key _val; do [ -z "$_key" ] && continue + if [ "${DISINTO_CONTAINER:-}" = "1" ] && [ -n "${!_key:-}" ]; then + continue + fi export "$_key=$_val" done <<< "$_PROJECT_VARS" From fb44a9b248651483f239a8f460e6c8b58009e898 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 27 Mar 2026 16:18:42 +0000 Subject: [PATCH 2/2] fix: agent-smoke: use [(][)] for literal parens in BRE regex Some BusyBox grep builds treat bare () as grouping operators even in BRE mode, causing get_fns to miss function definitions like ci_commit_status. Using [(][)] is unambiguous across all grep implementations. Co-Authored-By: Claude Opus 4.6 (1M context) --- .woodpecker/agent-smoke.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.woodpecker/agent-smoke.sh b/.woodpecker/agent-smoke.sh index 6fe8f49..14a4607 100644 --- a/.woodpecker/agent-smoke.sh +++ b/.woodpecker/agent-smoke.sh @@ -21,10 +21,11 @@ FAILED=0 # Uses awk instead of grep -Eo for busybox/Alpine compatibility (#296). get_fns() { local f="$1" - # BRE mode (no -E): () is literal in BRE, avoiding BusyBox ERE bugs - # where \(\) is misinterpreted. BRE one-or-more via [X][X]* instead of +. - grep '^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_][a-zA-Z0-9_]*[[:space:]]*()' "$f" 2>/dev/null \ - | sed 's/^[[:space:]]*//; s/[[:space:]]*().*$//' \ + # BRE mode (no -E). Use [(][)] for literal parens — unambiguous across + # GNU grep and BusyBox grep (some BusyBox builds treat bare () as grouping + # even in BRE). BRE one-or-more via [X][X]* instead of +. + grep '^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_][a-zA-Z0-9_]*[[:space:]]*[(][)]' "$f" 2>/dev/null \ + | sed 's/^[[:space:]]*//; s/[[:space:]]*[(][)].*$//' \ | sort -u || true }