feat: let a profile name the runner, so Apple's container works - #29
Merged
Conversation
Profiles were hard-wired to `docker run`. The argument spelling termit
emits (-v, -w, -e, --network, -it, --rm) is not Docker-specific, so a
profile now names the command:
runner = "container" # defaults to docker
runner_args = ["--memory", "2048MB"] # inserted just before the image
`runner_args` is the escape hatch for flags termit knows nothing about,
and `network` is now only passed when set, because the name differs per
runner (docker: bridge, container: default) and both reach the network by
default anyway. No runner name appears anywhere in the code except as
that default.
Verified end to end against Apple's container 1.4.1: an ignored test
spawns a real container through termit's own pty path and asserts the
guest output reaches the grid and that 40x120 arrives inside. Warm start
was 0.74s, an interactive prompt 1.02s.
One measured caveat is documented rather than worked around: for about
the first second the guest terminal is 0x0 before the real size arrives.
Re-sending the same size raises no SIGWINCH, so a workaround inside
termit would have to jiggle the size and flicker; starting the agent
through `sh -c 'sleep 1.5; exec claude'` avoids the window from config.
docs/references/sandbox.md records the survey behind this: the six
isolation levels, sbx (Docker Sandboxes, microVM per session with
credential injection at a host proxy), and what termit deliberately
leaves outside — sbx-shaped argument lists, git worktrees per fork, and
credential injection.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GvMacYD6T9EoWqc7C247Hr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Profiles were hard-wired to
docker run. The argument spelling termit emits (-v,-w,-e,--network,-it,--rm) is not Docker-specific, so a profile can now name the command instead.runnerdefaults todocker, so existing configs are unchanged.runner_argsis the escape hatch for flags termit knows nothing about.networkis now passed only when set: the name differs per runner (dockerbridge, containerdefault) and both reach the network by default.network = "none"under Docker still closes it.Verified against Apple's container 1.4.1
An
#[ignore]d test spawns a real container through termit's own pty path and asserts both that guest output reaches the grid and thatstty sizeinside reports40 120:Measured while trying it:
The caveat, documented rather than worked around
For about the first second the guest terminal size is
0 0; the real size arrives after that, and later resizes propagate correctly:So a full-screen UI that reads its size once at startup can come up at 80 columns. Re-sending the same size raises no SIGWINCH, so a fix inside termit would have to jiggle the size and flicker the screen. Config avoids it instead:
Upstream has no issue for this (apple/container#1747 is about SIGWINCH forwarding errors, a different thing).
Docs
docs/references/sandbox.mdis new: the six isolation levels from Anthropic's own comparison, howsbx(Docker Sandboxes) differs — microVM per session, credentials kept on the host and injected at a proxy,--branch autoworktrees — thecontainermeasurements above, and what termit deliberately leaves outside:sbx run <agent>does not fit; supporting it means generalising to a command template and giving up theimage/mount/networkvocabulary. Decide when it is actually needed.[agent] forkcan rungit worktree additself.envis as strong as the host, and that is now said plainly rather than implied.README and the design spec follow the same change.
Test
cargo test— 206 pass, 1 ignored (the container one).cargo clippy --all-targets -- -D warningsandcargo fmt --check— clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01GvMacYD6T9EoWqc7C247Hr