fix(@scripts): 🐛 add mcp config flag for supervisor sessions

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-05-18 21:14:09 -07:00
parent 977695a1a8
commit 926b41941a

View file

@ -1503,8 +1503,16 @@ build_inner() {
_back=$(caller_hostname)
_back_env="export SPEECH_PLAYBACK_HOST=${_back}; "
fi
# Supervisor-spawned sessions (clare) need MCP servers wired without the
# interactive trust-prompt round-trip. RCLAUDE_MCP_CONFIG forwards a JSON
# config path to `claude --mcp-config <path>`. Quoted to survive spaces.
_mcp_flag=""
if [ -n "${RCLAUDE_MCP_CONFIG:-}" ]; then
_mcp_esc=$(printf %s "$RCLAUDE_MCP_CONFIG" | sed "s/'/'\\\\''/g")
_mcp_flag="--mcp-config '${_mcp_esc}'"
fi
printf '%s' \
"${_back_env}cd ${1} && rc_t=\$(date +%s); claude ${_resume_flag} ${_name_flag} ${flag}; rc_ec=\$?; " \
"${_back_env}cd ${1} && rc_t=\$(date +%s); claude ${_resume_flag} ${_name_flag} ${_mcp_flag} ${flag}; rc_ec=\$?; " \
"rc_e=\$(date +%s); rc_d=\$((rc_e - rc_t)); " \
"if [ \$rc_ec -ne 0 ] || [ \$rc_d -lt 2 ]; then " \
"printf '\\n[rclaude] claude exited in %ds with code %d\\n' \$rc_d \$rc_ec; " \