Agent teams: shutdown_approved shows paneId "[invalid id]" under cmux (pane id regex caps at 10 digits)
Running agent teams inside cmux (cmux claude-teams, which puts a tmux shim on PATH), every shutdown_approved message I get back from a teammate has the pane id replaced:
{"type":"shutdown_approved","requestId":"shutdown-...@s1","from":"s1","timestamp":"...","paneId":"[invalid id]","backendType":"tmux"}
The pane id is fine. cmux just hands out much longer pane ids than real tmux, e.g. %8392977483769161943 (19 digits). The message display sanitizer only accepts
/^(%[0-9]{1,10}|<uuid>)$/
so anything past 10 digits gets swapped for "[invalid id]".
As far as I can tell it's display only. Spawning reads pane ids as strings via -F "#{pane_id}", and I spawned 8 teammates and shut down 6 without problems; processes exited and panes closed. But it's confusing when you're debugging teams under cmux, because it looks like Claude Code lost track of the pane. That cost me some time chasing the wrong thing.
Possible fix: loosen the digit cap, e.g. %[0-9]{1,20} covers a full unsigned 64-bit id.
Repro:
- Start Claude Code with
cmux claude-teams(CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1) - Spawn a named teammate
- Send it a shutdown_request
- The shutdown_approved message shows
"paneId": "[invalid id]"
Versions: Claude Code 2.1.332, cmux 0.65.2 (build 113), macOS on Apple Silicon.
Related: #36926 (cmux as a teammateMode backend).