fix(pty): cooked-mode echo/signal discipline + kernel-PTY stdin for TTY guests#179
Merged
Conversation
…ommand table
The { packageDir } projection lands each package's bin/<cmd> at
/opt/agentos/bin/<cmd> and puts that directory on PATH, but never
registered the commands in the kernel command table (only 'provides'
populates /__secure_exec/commands), so spawning any projected wasm
command failed with ENOEXEC/ENOENT. Register each projected command's
/opt/agentos/bin entrypoint after mount setup, mirroring what
discover_command_guest_paths does for provides, and refresh the guest
PATH env accordingly.
c783db8 to
8c664c7
Compare
8c664c7 to
21cc55d
Compare
|
🚅 Environment secure-exec-pr-179 in rivet-frontend has no services deployed. 🚅 Deployed to the secure-exec-pr-179 environment in secure-exec
|
21cc55d to
6d7feea
Compare
6d7feea to
0ec005d
Compare
0ec005d to
28d52e0
Compare
…TY guests Kernel (pty.rs): - LineDisciplineConfig gains opost/onlcr toggles so raw mode disables output post-processing (cfmakeraw parity) and cooked mode restores it. - Signal chars (^C / ^\ / ^Z) echo their caret form only when no foreground process group is attached; with a foreground pgroup the byte is consumed as a signal and never echoed. Sidecar: - Track the PTY master fd on ActiveProcess and drain the master output buffer after every host stdin write, surfacing cooked-mode echo (and ONLCR-processed guest output) as the single ordered Stdout stream. - Route cooked-TTY guest stdout through the PTY slave (OPOST/ONLCR); raw-TTY output passes through unmodified for full-screen apps. - __pty_set_raw_mode toggles opost/onlcr alongside icanon/echo/isig. - TTY guest-node: dup2 the PTY slave onto fds 0-2 and, after each master write, forward the cooked slave input to the isolate's stream-stdin dispatch (VEOF propagates as end-of-stdin), so echo, VERASE/VKILL/ VWERASE, ICRNL, VEOF and ISIG signals behave like a real TTY for process.stdin. Wasm runner: - Report kernel-PTY stdio fds as CHARACTER_DEVICE in fd_fdstat_get (and answer the host-env isatty shim from the kernel), so guest is_terminal()/isatty() finally see the TTY — the runner-process fds behind the delegate are pipes. Fixes interactive guests that gate behavior on stdin being a terminal (e.g. brush suppressing its prompt). - host_tty.read short-polls __kernel_stdin_read in 10ms slices instead of one long blocking read: a long read occupies the sidecar service loop, so the host->guest stdin write it waits for (e.g. the CPR reply to crossterm's cursor-position query) queues behind it and the read self-deadlocks until timeout. Registry (native): - Enable brush's reedline feature for the wasm sh build (history, arrows, reverse search in the VM shell). The wasi support patches for crossterm/brush-interactive/fd-lock already existed; the remaining gap was upstream brush-interactive declaring tokio only for unix/windows while its reedline modules use tokio::sync unconditionally — added as patches/crates/brush-interactive/0002-wasi-tokio-dep.patch. Bridge (bridge-src): - New tty-config resolver derives process.stdin/stdout/stderr isTTY and cols/rows from _kernelIsatty/_kernelTtySize with safe fallbacks; process/console builtins consume it.
28d52e0 to
8c4ba5f
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.
{ packageDir }package bin commands in the kernel command table so projected wasm commands can spawn (previously ENOEXEC/ENOENT)