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 <noreply@anthropic.com>
This commit is contained in:
A 2026-02-11 16:28:21 -08:00 committed by GitHub
parent 7c693db35b
commit 3679fd2b3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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}?"