You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #671 (PTY execution backend epic). Blocked by: #673 (PtyBackend implementation).
Update the CLI to support the new PTY backend and expose PTY-specific session management capabilities.
Problem
The CLI's wrap commands currently assume tmux sessions. With three backends (tmux, docker, pty), the CLI needs:
A way to specify or detect which backend is active
PTY-specific features (attach to session for interactive use)
Consistent behavior across backends
Changes
1. Backend-Aware Session Commands
The existing agent wrap commands should work transparently across backends. The CLI already communicates with the wrap/orchestrator service via REST, so most commands need no changes. However, new capabilities should be exposed:
# Existing commands (work unchanged)
agent wrap list
agent wrap kill<session>
agent wrap launch --agent-type claude-code ...
agent wrap health
# New: show backend info
agent wrap info # Shows active backend type, version, capabilities# New: attach to PTY session (PTY backend only)
agent wrap attach <session># Opens interactive terminal to PTY session
2. Backend Configuration
# Environment variable (already exists for orchestrator)
AGENTD_BACKEND=pty # or tmux (default), docker# CLI flag override for wrap service
agent wrap launch --backend pty ...
3. Session Info Enhancement
The agent wrap list output should indicate the backend type and session capabilities:
NAME BACKEND STATUS CAPABILITIES
agentd-orch-abc123 pty running terminal,interactive
agentd-orch-def456 tmux running attach-tmux
agentd-orch-ghi789 docker running health-check,logs
4. PTY Attach Command
For PTY backend sessions, the attach command opens an interactive terminal:
Connects to the orchestrator's /terminal/{agent_id} WebSocket endpoint
Uses crossterm for raw terminal mode in the CLI
Forwards all input/output between the local terminal and remote PTY
Ctrl-D or special key sequence to detach
Implementation Steps
Add info subcommand to WrapCommand enum in crates/cli/src/commands/wrap.rs
Add attach subcommand with session name argument
Implement attach using crossterm raw mode + WebSocket client to /terminal/{agent_id}
Context
Part of #671 (PTY execution backend epic). Blocked by: #673 (PtyBackend implementation).
Update the CLI to support the new PTY backend and expose PTY-specific session management capabilities.
Problem
The CLI's
wrapcommands currently assume tmux sessions. With three backends (tmux, docker, pty), the CLI needs:Changes
1. Backend-Aware Session Commands
The existing
agent wrapcommands should work transparently across backends. The CLI already communicates with the wrap/orchestrator service via REST, so most commands need no changes. However, new capabilities should be exposed:2. Backend Configuration
3. Session Info Enhancement
The
agent wrap listoutput should indicate the backend type and session capabilities:4. PTY Attach Command
For PTY backend sessions, the
attachcommand opens an interactive terminal:/terminal/{agent_id}WebSocket endpointcrosstermfor raw terminal mode in the CLIImplementation Steps
infosubcommand toWrapCommandenum incrates/cli/src/commands/wrap.rsattachsubcommand with session name argumentattachusingcrosstermraw mode + WebSocket client to/terminal/{agent_id}--backendflag tolaunchsubcommandlistoutput to include backend typecrosstermdependency to CLI crateRelevant Files
crates/cli/src/commands/wrap.rs— wrap subcommandscrates/cli/src/commands/mod.rs— command registrationcrates/cli/Cargo.toml— dependenciescrates/common/src/client.rs— service client baseAcceptance Criteria
agent wrap infoshows active backend type and capabilitiesagent wrap attach <session>opens interactive terminal for PTY sessionsagent wrap attachreturns clear error for non-PTY backendsagent wrap listshows backend type per sessionCaution
All work for this issue must branch from
feature/autonomous-pipelineand PR back into it — never directly tomain.