Redesign guest ProcessService and FileSystemService - #65
Draft
Jaana Dogan (rakyll) wants to merge 1 commit into
Draft
Redesign guest ProcessService and FileSystemService#65Jaana Dogan (rakyll) wants to merge 1 commit into
Jaana Dogan (rakyll) wants to merge 1 commit into
Conversation
Jaana Dogan (rakyll)
force-pushed
the
proto
branch
2 times, most recently
from
September 12, 2026 05:13
954feca to
0d24b66
Compare
ProcessService is rebuilt around a five-RPC surface with streaming stdin,
POSIX signals, and an output stream that carries the exit status:
- StartProcess returns the full Process resource. The request gains
`stdin` (open a pipe) and `timeout` (per-process SIGKILL deadline).
- StreamProcessOutput streams a oneof of stdout/stderr chunks and ends
with a final `exit` message carrying the finished Process, so clients
no longer poll GetProcess for the exit code. Offsets past the end of
the spool suppress output, which makes "follow with max offsets" the
way to wait for exit without transferring data.
- WriteProcessInput is client-streaming; stdin stays open across calls
until a message sets `close`, enabling interactive use.
- SignalProcess delivers any standard POSIX signal (new Signal enum) to
the process group and replaces KillProcess.
Process now carries command and pid, a two-state ProcessState
(RUNNING/EXITED), and a single exit_code using the shell convention
(128 + signal number when killed by a signal). The old COMPLETED/
FAILED/TERMINATED statuses are gone.
Guest process tracker: return plain sentinel errors mapped to gRPC codes
by the service layer, wake output streamers on write via a notifier
instead of polling every 50ms, and map the Signal enum to host syscall
signals by name so tests pass on non-Linux hosts.
FileSystemService: ReadFile streams ReadFileResponse{chunk} instead of
FileChunk{data}. ReadFileRequest gains `mode`: when set and the file is
missing, the guest creates it empty with that mode (parent directories
included) and ends the stream without chunks; when zero, a missing file
remains NOT_FOUND; existing files are never modified. WriteFileRequest
gains `seek_offset`: zero keeps the replace-the-file behaviour, a
positive offset writes in place from that byte, zero-filling any gap
and preserving bytes outside the written range; negative offsets are
INVALID_ARGUMENT. Fields are reordered to path, mode, seek_offset,
chunk, with path/mode/seek_offset read from the first message only.
Update the API proxy, the MCP shell tool (new stdin and timeout_seconds
params), the Go SDK (Process handle with Info/Wait/Output/Stdin/Signal/
Kill, Env.Run taking a ShellRequest, Env.WriteFileAt), the Python SDK
(Process class, Signal/ProcessState enums, ProcessExitedError,
write_file seek_offset), the CLI shell command (--stdin, --timeout),
regenerated Go and Python stubs, and READMEs. Add server, SDK, fake,
and e2e tests throughout.
This is a breaking change to the alpha API.
Jaana Dogan (rakyll)
force-pushed
the
proto
branch
from
September 12, 2026 05:22
0d24b66 to
4468a20
Compare
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.
ProcessService is rebuilt around a five-RPC surface with streaming stdin,
POSIX signals, and an output stream that carries the exit status:
stdin(open a pipe) andtimeout(per-process SIGKILL deadline).with a final
exitmessage carrying the finished Process, so clientsno longer poll GetProcess for the exit code. Offsets past the end of
the spool suppress output, which makes "follow with max offsets" the
way to wait for exit without transferring data.
until a message sets
close, enabling interactive use.the process group and replaces KillProcess.
Process now carries command and pid, a two-state ProcessState
(RUNNING/EXITED), and a single exit_code using the shell convention
(128 + signal number when killed by a signal). The old COMPLETED/
FAILED/TERMINATED statuses are gone.
Guest process tracker: return plain sentinel errors mapped to gRPC codes
by the service layer, wake output streamers on write via a notifier
instead of polling every 50ms, and map the Signal enum to host syscall
signals by name so tests pass on non-Linux hosts.
FileSystemService: ReadFile streams ReadFileResponse{chunk} instead of
FileChunk{data}. ReadFileRequest gains
mode: when set and the file ismissing, the guest creates it empty with that mode (parent directories
included) and ends the stream without chunks; when zero, a missing file
remains NOT_FOUND; existing files are never modified. WriteFileRequest
gains
seek_offset: zero keeps the replace-the-file behaviour, apositive offset writes in place from that byte, zero-filling any gap
and preserving bytes outside the written range; negative offsets are
INVALID_ARGUMENT. Fields are reordered to path, mode, seek_offset,
chunk, with path/mode/seek_offset read from the first message only.
Update the API proxy, the MCP shell tool (new stdin and timeout_seconds
params), the Go SDK (Process handle with Info/Wait/Output/Stdin/Signal/
Kill, Env.Run taking a ShellRequest, Env.WriteFileAt), the Python SDK
(Process class, Signal/ProcessState enums, ProcessExitedError,
write_file seek_offset), the CLI shell command (--stdin, --timeout),
regenerated Go and Python stubs, and READMEs. Add server, SDK, fake,
and e2e tests throughout.
This is a breaking change to the alpha API.