Conversation
There was a problem hiding this comment.
Pull request overview
Adds interactive TTY shell support to the Aviato Python SDK and exposes it via a new aviato shell CLI command, with accompanying docs and tests.
Changes:
- Introduce
TerminalSession/TerminalResultand genericStreamReader[T]to support raw-byte streaming for TTY sessions. - Add
Sandbox.shell()backed by a new streaming TTY exec path with resize + stdin multiplexing. - Register
aviato shellCLI command and add docs + unit/integration coverage.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/aviato/test_utilities.py | Extends wait() mixed-type tests to include TerminalSession. |
| tests/unit/aviato/test_types.py | Adds unit tests for TerminalResult and TerminalSession. |
| tests/unit/aviato/test_sandbox.py | Adds unit tests for Sandbox.shell() and a stream_logs close/cancel case. |
| tests/unit/aviato/test_cli_shell.py | New unit tests for aviato shell behavior and guards. |
| tests/integration/aviato/test_sandbox.py | Adds integration test ensuring shell sessions don’t disrupt a running sandbox. |
| tests/AGENTS.md | Documents new CLI shell test coverage. |
| src/aviato/cli/shell.py | Implements aviato shell interactive TTY command (Unix-only). |
| src/aviato/cli/init.py | Registers the new shell command with the CLI group. |
| src/aviato/_types.py | Adds TerminalSession/TerminalResult; makes StreamReader generic for bytes/text. |
| src/aviato/_sandbox.py | Implements TTY streaming exec and Sandbox.shell() entrypoint. |
| src/aviato/init.py | Exports new types and extends Waitable/wait() to cover TTY sessions. |
| src/aviato/AGENTS.md | Updates internal package map to include TerminalSession and cli/shell.py. |
| mkdocs.yml | Adds “Interactive Shells” guide to documentation nav. |
| docs/guides/troubleshooting.md | Adds troubleshooting notes for aviato shell on Windows / raw terminal recovery. |
| docs/guides/sync-vs-async.md | Documents shell() behavior in sync vs async contexts. |
| docs/guides/interactive-shells.md | New guide explaining TTY sessions, resize, and CLI usage. |
| docs/guides/execution.md | Links to shell() for interactive use cases. |
| docs/guides/AGENTS.md | Documents guidance conventions for TerminalSession / shell(). |
| DEVELOPMENT.md | Adds aviato shell to dev command examples. |
| AGENTS.md | Updates top-level usage docs to include shell() and interactive session types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b50a181 to
c128504
Compare
c128504 to
17a1f77
Compare
17a1f77 to
000d60c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
000d60c to
468ad31
Compare
468ad31 to
9d3d8ff
Compare
9d3d8ff to
3484f8f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3484f8f to
945cd6e
Compare
945cd6e to
7d71d8e
Compare
7d71d8e to
405e4b0
Compare
3aabf5b to
3a69308
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3a69308 to
76db808
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
76db808 to
a0d2ba0
Compare
a0d2ba0 to
36a72e5
Compare
36a72e5 to
6771985
Compare
3025bfa to
a23cc13
Compare
a23cc13 to
b81e1d3
Compare
Make StreamReader a Generic[_S] parameterized over str (text streams) and bytes (raw TTY output). Add TerminalResult and TerminalSession types for interactive TTY sessions. Update Waitable type alias and __all__ exports.
Add _exec_streaming_tty_async for raw-byte TTY streaming with resize support, and the public shell() method that returns a TerminalSession. Widen _on_exec_complete to accept TerminalResult.
Remote debugging and interactive workflows need direct terminal access to sandboxes without writing Python. Add `cwsandbox sh` with raw mode, SIGWINCH resize, and terminal state restore on exit.
Cover SDK shell() usage, terminal resize, stdin/stdout streaming, and a comparison table for choosing between exec and shell.
Summary
Adds interactive terminal sessions to the SDK and CLI, enabling researchers to drop into a running sandbox like a normal SSH session.
TerminalSession/TerminalResult— New types for TTY sessions. UnlikeProcess, output is rawbytes(no UTF-8 decode/re-encode), there is no output accumulation (streamed via queues), and the result contains only an exit codeStreamReadergeneric —StreamReader[_S]parameterized overstr(text streams) andbytes(raw TTY output)Sandbox.shell()— New SDK method that opens a bidirectional TTY stream viaStreamExecwithtty=True. Supports custom commands and terminal resizecwsandbox sh— Unix-only CLI command for interactive shell sessions. Raw terminal mode forwards all keystrokes (including Ctrl+C) to the remote process. SIGWINCH handler keeps remote PTY dimensions in syncWaitable/wait()extended —TerminalSessionadded to theWaitabletype alias andwait()utilityDesign decisions
shell()defaults to["/bin/bash"]matching the most common container setupisatty()check runs before sandbox connection to fail fast when piped or under CITest plan
TerminalSessionandTerminalResulttypescwsandbox sh— happy path, Windows guard, non-TTY guard, custom cmd, not-found, nonzero exit, keyboard interrupt