Agent Teams: "Surface not found" when creating new team after previous team shutdown

Resolved 💬 3 comments Opened Apr 5, 2026 by chyouk-han Closed Apr 8, 2026

Environment

  • cmux 0.63.1
  • Claude Code (cmux claude-teams --dangerously-skip-permissions)
  • macOS Darwin 24.6.0

Steps to Reproduce

  1. Start session with cmux claude-teams
  2. Create a team with TeamCreate
  3. Spawn teammates with Agent tool (team_name parameter) → panes created successfully
  4. Shutdown all teammates with SendMessage shutdown_request
  5. TeamDelete to clean up
  6. Create a new team with TeamCreate
  7. Spawn teammates again → fails

Expected

New teammates should get new cmux panes after previous team is deleted.

Actual

All subsequent Agent(team_name=...) calls fail with:

Failed to create teammate pane: Error: not_found: Surface not found

cmux itself is healthy — cmux tree, cmux surface-health, cmux new-pane all work fine.
Manual pane creation via cmux new-pane --direction right succeeds.

Workaround

Restart the session (cmux claude-teams -c). First team in a fresh session works.

Analysis

After the first team's agent panes are closed via shutdown, claude-teams' internal surface mapping appears to retain stale surface UUIDs. New team creation tries to reference these stale surfaces instead of creating fresh ones.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗