Feat/oci runtime groundwork - #1370
Open
Unique-Usman wants to merge 4 commits into
Open
Conversation
|
|
||
| pub(crate) fn initial_stdin_messages(stdin_mode: &StdinMode) -> Vec<ExecStdin> { | ||
| match stdin_mode { | ||
| StdinMode::Null => vec![ExecStdin { data: Vec::new() }], |
There was a problem hiding this comment.
When an execution combines the default StdinMode::Null with tty(true), this empty message reaches close_stdin, which only drops pipe stdin and leaves the PTY master open. A command that reads from stdin, such as cat, therefore waits indefinitely instead of receiving EOF.
Prompt To Fix With AI
This is a comment left during a code review.
Path: sdk/rust/lib/sandbox/exec.rs
Line: 513
Comment:
**Null stdin stays open on PTYs**
When an execution combines the default `StdinMode::Null` with `tty(true)`, this empty message reaches `close_stdin`, which only drops pipe stdin and leaves the PTY master open. A command that reads from stdin, such as `cat`, therefore waits indefinitely instead of receiving EOF.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Parse and validate OCI bundles with `oci-spec`, resolve root filesystem paths, and model OCI lifecycle transitions with Microsandbox state. Persist state atomically beneath the runtime root. Keep the bundle, state, lifecycle, store, and error types independent of the `runmsb` CLI so future integrations can reuse them. Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Prepare `devpts` for OCI terminal workloads with standard mount options. Keep the `/dev/ptmx` symlink as a defensive fallback. Resolve bare commands through the shared conventional `PATH`, support numeric OCI users, preserve allocation-safe spawn errors, and apply guest user and security settings consistently. Translate signal termination into shell-compatible statuses so Docker reports 143 for SIGTERM and 137 for SIGKILL instead of 255. Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Capture detached sandbox stderr in `startup.stderr.log` and include its final 8 KiB when startup times out or exits before returning valid startup information. Release startup log metrics on every completion path so failures remain visible through Docker and containerd without leaking metric registrations. Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Centralize initial stdin protocol messages for local and cloud execution. Close null stdin immediately, leave piped stdin open, and send fixed bytes followed by EOF. Add focused and end-to-end coverage so programs such as `cat` and Python do not wait indefinitely for input. Document this behavior and conventional signal exit statuses. Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Unique-Usman
force-pushed
the
feat/oci-runtime-groundwork
branch
from
August 18, 2026 21:27
53e880c to
c2cf519
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.
TL;DR
Add reusable guest-process, state, stdin, and startup-diagnostic support
needed by an OCI runtime, without introducing the
runmsbCLI itself.Description
contextual errors, and an atomic filesystem state store under
crates/runtime/lib/oci.races, shared temporary filenames, and interrupted writes.
agentdprocess execution for OCI workloads, including defensive/dev/ptmxsetup, standarddevptspermissions, bare-command lookupthrough
PATH, numeric users, and conventional128 + signalexitstatuses.
pre_execfailures allocation-free by converting setup failures toplain
errno-based I/O errors.startup failures while releasing metrics reservations on every error path.
stdin sends EOF, byte input sends data followed by EOF, and piped stdin
remains open.
catexits when launchedwith null stdin.
changelog.
Test Plan
The final stdin integration test requires a host capable of starting
Microsandbox VMs.
Sequence Diagram
sequenceDiagram participant SDK participant AgentClient participant Agentd participant Process SDK->>AgentClient: ExecRequest AgentClient->>Agentd: Start session Agentd->>Process: Spawn with pipe or PTY SDK->>AgentClient: Initial ExecStdin messages AgentClient->>Agentd: Data and/or empty EOF message alt Pipe stdin Agentd->>Process: Write data or drop ChildStdin else PTY stdin Agentd->>Process: Write through PTY master Note over Agentd,Process: Empty message cannot close PTY input end Process-->>Agentd: Output and exit Agentd-->>SDK: Exec eventsPrompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix(exec): send EOF for non-interactive ..." | Re-trigger Greptile