From da938c265457145514493cdd6038887306cc441a Mon Sep 17 00:00:00 2001 From: Dr Alexander Mikhalev Date: Fri, 3 Apr 2026 20:19:46 +0100 Subject: [PATCH 1/2] fix: unicode arrow parsing in trace logging and macOS temp path test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix bash variable parsing on line 168 where unicode arrow (→) caused unbound variable error for $DEPTH→ (changed to ${DEPTH}→) - Fix test T14d hardcoded /tmp/ path that fails on macOS which uses /var/folders/ for TMPDIR --- rlm_query | 2 +- tests/test_unit.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rlm_query b/rlm_query index 61dfb66..916d66e 100755 --- a/rlm_query +++ b/rlm_query @@ -165,7 +165,7 @@ fi # Trace logging (optional) # ---------------------------------------------------------------------- if [ -n "${PI_TRACE_FILE:-}" ]; then - echo "[$(date +%H:%M:%S.%3N)] depth=$DEPTH→$NEXT_DEPTH PID=$$ PPID=$PPID call=$RLM_CALL_COUNT trace=$RLM_TRACE_ID fork=$FORK prompt: ${PROMPT:0:120}" >> "$PI_TRACE_FILE" + echo "[$(date +%H:%M:%S.%3N)] depth=${DEPTH}→${NEXT_DEPTH} PID=$$ PPID=$PPID call=$RLM_CALL_COUNT trace=$RLM_TRACE_ID fork=$FORK prompt: ${PROMPT:0:120}" >> "$PI_TRACE_FILE" fi # ---------------------------------------------------------------------- diff --git a/tests/test_unit.sh b/tests/test_unit.sh index 5f9425a..0abba60 100644 --- a/tests/test_unit.sh +++ b/tests/test_unit.sh @@ -340,7 +340,8 @@ OUTPUT=$( CONTEXT="$TEST_TMP/ctx.txt" \ rlm_query "How many r's in strawberry?" ) -assert_contains "T14d: prompt file is set" "RLM_PROMPT_FILE=/tmp/rlm_prompt_" "$OUTPUT" +assert_contains "T14d: prompt file is set" "RLM_PROMPT_FILE=" "$OUTPUT" +assert_contains "T14d: prompt file path contains rlm_prompt" "rlm_prompt_" "$OUTPUT" assert_contains "T14d: prompt file has content" "PROMPT_CONTENT=How many r's in strawberry?" "$OUTPUT" # ─── Test Group: Temp File Cleanup ──────────────────────────────────────── From 6f25cf3dba7675bcc73488fdea25af7247e9670c Mon Sep 17 00:00:00 2001 From: Dr Alexander Mikhalev Date: Fri, 3 Apr 2026 21:42:00 +0100 Subject: [PATCH 2/2] fix: pass RLM_PROVIDER and RLM_MODEL to root pi session The ypi script was not forwarding RLM_PROVIDER/RLM_MODEL to the root pi invocation, so the root session always used pi's default model (k2p5) instead of the configured model (glm-5). Now the root session starts with the configured provider/model, while child sessions continue to use RLM_CHILD_PROVIDER/RLM_CHILD_MODEL. --- ypi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ypi b/ypi index 5462c1d..7b3d525 100755 --- a/ypi +++ b/ypi @@ -121,7 +121,10 @@ while [[ $# -gt 0 ]]; do done # Launch Pi with the combined system prompt, passing all args through # User's own extensions (hashline, etc.) are discovered automatically by Pi. +# Pass through RLM_PROVIDER/RLM_MODEL to the root session if set. PI_ARGV=(pi --system-prompt "$COMBINED_PROMPT") +[ -n "${RLM_PROVIDER:-}" ] && PI_ARGV+=(--provider "$RLM_PROVIDER") +[ -n "${RLM_MODEL:-}" ] && PI_ARGV+=(--model "$RLM_MODEL") [ ${#YPI_EXT_ARGS[@]} -gt 0 ] && PI_ARGV+=("${YPI_EXT_ARGS[@]}") [ ${#PASS_ARGS[@]} -gt 0 ] && PI_ARGV+=("${PASS_ARGS[@]}") exec "${PI_ARGV[@]}"