google / google/capsem

Guest exec stdin, stderr separation and cancellation

Open
#211 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
72
Forks
13
Avg merge
1d 2h
Merged PRs (30d)
5

Description

## Problem

The guest exec path has no stdin and no stderr separation:

- The agent runs `bash -c` with stdout and stderr piped into one VSOCK 5005 connection (merged, interleaved at 8 KiB boundaries). No stdin is set, and there is no host cancel.
- `ExecResult.stderr` is always empty for guest output and gets reused for owner-side error text.

## Outcome

- A guest protocol carrying stdin (with explicit EOF), separate stdout/stderr lanes, and host-initiated cancellation. VSOCK half-close is unreliable on Apple VZ, so EOF must be in-band.
- The #207 stream API already reserves channel `0` (stdin) and channel `2` (stderr), so clients need no new protocol.
- Container attach (`capsem run --image`) gets interactive stdin.

## Depends on

#207.

Contributor guide

Open the contributing guide

Research direction

Start with the guest exec path and the #207 stream API, especially reserved channels 0 (stdin) and 2 (stderr). Trace the VSOCK 5005 connection and `capsem run --image` container attach flow; done means in-band EOF, separate stdout/stderr, host cancellation, and interactive stdin.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, cli, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.