From 3679fd2b3ae698e140027230f702bc587ef0bc30 Mon Sep 17 00:00:00 2001 From: A <258483684+la14-1@users.noreply.github.com> Date: Wed, 11 Feb 2026 16:28:21 -0800 Subject: [PATCH] fix: redirect echo to stderr in get_model_id_interactive to prevent JSON corruption (#554) The `echo ""` on line 351 of get_model_id_interactive() was going to stdout, causing it to be captured by command substitution into MODEL_ID. This injected a newline into the openclaw.json config, breaking JSON parsing with "invalid character '\n' at 15:0". Fixes #553 Agent: issue-fixer Co-authored-by: A <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 --- shared/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/common.sh b/shared/common.sh index ffe56cd9..08069c0d 100644 --- a/shared/common.sh +++ b/shared/common.sh @@ -348,7 +348,7 @@ get_model_id_interactive() { return 0 fi - echo "" + echo "" >&2 log_info "Browse models at: https://openrouter.ai/models" if [[ -n "${agent_name}" ]]; then log_info "Which model would you like to use with ${agent_name}?"