Skip to content

feat: add hidden spawn CLI command for container environments#129

Merged
khaliqgant merged 2 commits intomainfrom
spawn-command-for-pty
Jan 10, 2026
Merged

feat: add hidden spawn CLI command for container environments#129
khaliqgant merged 2 commits intomainfrom
spawn-command-for-pty

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

  • Adds agent-relay spawn CLI command that uses dashboard API instead of tmux
  • Works in container environments (cloud) where tmux is not available
  • Command is hidden from help since agents should use ->relay:spawn pattern

Problem

When agents in cloud containers ran agent-relay spawn DeveloperProvisioner claude << 'EOF', they got TmuxNotFoundError because:

  1. No explicit spawn command existed in CLI
  2. Default action interpreted spawn as a command to wrap with TmuxWrapper
  3. TmuxWrapper requires tmux, which isn't in containers

Solution

Added a proper spawn command that uses POST /api/spawn (PtyWrapper-based, no tmux required).

Test plan

  • Build passes
  • Tests pass (1197 passed)
  • Command hidden from --help
  • Command accessible via agent-relay spawn --help

🤖 Generated with Claude Code

khaliqgant and others added 2 commits January 10, 2026 08:36
When agents run in cloud containers without tmux, they can now use
`agent-relay spawn` directly. This command uses the dashboard's
POST /api/spawn endpoint (PtyWrapper-based) instead of TmuxWrapper.

The command is hidden from help since agents should use the
`->relay:spawn` pattern, but the CLI command is available as fallback.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Import SpawnRequest/SpawnResult types for type-safe spawn requests
- Add --spawner flag for policy enforcement (who is requesting the spawn)
- Add --interactive flag for auth setup flows (disables auto-accept)
- Add --cwd flag for working directory specification
- Add shadow agent options (--shadow-mode, --shadow-of, --shadow-agent,
  --shadow-triggers, --shadow-speak-on)
- Validate shadow mode values and trigger lists
- Display policy denial details on spawn failure
- Update dashboard API to accept spawnerName and cwd fields

This ensures the CLI spawn command is fully consistent with the
SpawnRequest interface and enables policy enforcement when needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit d9e2b1e into main Jan 10, 2026
6 checks passed
@khaliqgant khaliqgant deleted the spawn-command-for-pty branch January 10, 2026 12:14
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.

1 participant