Skip to content

fix(restart-bot): brace-delimit $BOT_PLIST before U+2026 ellipsis (set -u unbound var)#129

Merged
fitz123 merged 1 commit into
mainfrom
fix/restart-bot-plist-unbound
May 30, 2026
Merged

fix(restart-bot): brace-delimit $BOT_PLIST before U+2026 ellipsis (set -u unbound var)#129
fitz123 merged 1 commit into
mainfrom
fix/restart-bot-plist-unbound

Conversation

@fitz123
Copy link
Copy Markdown
Owner

@fitz123 fitz123 commented May 30, 2026

Bug

bot/scripts/restart-bot.sh lines 153 & 249 write "...$BOT_PLIST…" — the variable abuts a U+2026 ellipsis with no delimiter. Under bash 5.3.9 + set -u the first byte of the multibyte ellipsis (0xE2) is absorbed into the variable name, so bash dereferences BOT_PLIST<0xE2> (an unset name) and aborts:

restart-bot.sh: line 153: BOT_PLIST<U+2026-byte>: unbound variable

This breaks the canonical restart-bot.sh --plist restart path on bash 5.3.9 and is the root cause of 5 failing full-suite tests.

Fix

${BOT_PLIST}… — brace-delimit the variable name so the ellipsis bytes stay literal. Applied to both occurrences (lines 153, 249). The other log lines already use ${VAR}… or $VAR (space-delimited) and are unaffected.

Verification (system bash 5.3.9)

$ bash -c 'set -u; BOT_PLIST=/tmp/x; printf "%s\n" "at $BOT_PLIST…"'
bash: BOT_PLIST<0xE2>: unbound variable        # bug reproduced
$ bash -c 'set -u; BOT_PLIST=/tmp/x; printf "%s\n" "at ${BOT_PLIST}…"'
at /tmp/x…                                      # fixed

bash -n clean. Found incidentally during the Pi RPC Plan A migration work (it surfaced as 5 pre-existing full-suite failures, byte-identical to main, outside that plan's scope — fixed here separately).

🤖 Generated with Claude Code

…t -u unbound var)

`log "...$BOT_PLIST…"` (lines 153, 249) abuts the variable directly against a
U+2026 ellipsis. Under bash 5.3.9 + `set -u`, the first byte of the multibyte
ellipsis (0xE2) is absorbed into the variable name, so bash dereferences
`BOT_PLIST<0xE2>` — an unset name — and aborts:

    restart-bot.sh: line 153: BOT_PLIST<U+2026-byte>: unbound variable

This breaks the canonical `--plist` restart path on bash 5.3.9 and is the cause
of the 5 failing full-suite tests. Fix: `${BOT_PLIST}…` (brace-delimit the name).

Verified on system bash 5.3.9: the bare form errors under `set -u`; the braced
form prints correctly. bash -n clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 30, 2026 20:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a bash set -u failure in restart-bot.sh where $BOT_PLIST directly precedes a U+2026 ellipsis, causing bash to treat the first byte of the ellipsis as part of the variable name and abort with an “unbound variable” error. This restores the restart-bot.sh --plist path under bash 5.3.9.

Changes:

  • Brace-delimit BOT_PLIST in the “Validating plist…” log message (${BOT_PLIST}…).
  • Brace-delimit BOT_PLIST in the “Bootstrapping…” log message (${BOT_PLIST}…).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fitz123 fitz123 merged commit 1e15168 into main May 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants