Repository navigation
feat(run): give the command an empty stdin, so no call needs < /dev/null (LAB-7678) - #6
Conversation
…ull (LAB-7678) ck spawns the command, so it can guarantee the command's stdin is empty instead of making the caller promise it. Every command now runs with stdin on /dev/null, whatever ck's own stdin is, and the stdin gate and its warning are gone. A call from a terminal, a CI pipe or an agent socket now caches the same way, and the key is unchanged, so existing entries keep hitting.
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
Kody Code Review — 2 suggested fixes. 🛠️ Open Agent Prompt |
ck never reads its stdin, so it can exit before the test writes to the pipe on its stdin. The write then fails with EPIPE and the unwrap panicked, making the_command_gets_an_empty_stdin_whatever_cks_is flaky under load. EPIPE means nothing read the pipe, so accept it and fail on any other error.
|
@kody start-review |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
ck runnow spawns every command with stdin on/dev/null, whatever ck's own stdin is, so no call needs< /dev/nulland every call caches the same way from a terminal, a CI pipe or an agent's socket.Closes LAB-7678
Why
The old rule cached a call only when the caller redirected stdin to
/dev/null. Forgetting the redirect never failed: the output stayed correct, one stderr line said caching was off, and the rate-limited origin took every hit. In each target context (shell startup file, CI step, agent shell) the default stdin failed the gate. ck spawns the command, so it can guarantee the empty stdin itself instead of asking the caller to promise it. This is what GNUxargsandssh -ndo.Changes
Supervisor::runsetsStdio::null()on every spawn, which covers a miss,--refresh, a fail-open run after a backend error, and output past the cap.uncacheable_stdinand its warning are deleted. ck never reads its own stdin.--scope), so existing entries, including ones written by< /dev/nullcalls, keep hitting./dev/null" section is now "The command does not get your stdin", and every example drops the redirect.ck run --helpsays the command gets an empty stdin.Tests
the_command_gets_an_empty_stdin_whatever_cks_isreplacesonly_dev_null_stdin_is_cached. It puts a terminal, a pipe, a socket and a regular file on ck's stdin, each holding data. For each, the second call hits, stderr is empty, the command read nothing, and a later< /dev/nullcall hits the same entry.a_pipe_that_never_closes_does_not_hang_ck: a pipe whose writer stays open and never writes does not hang ck, and the call caches.a_401_on_the_value_read_runs_uncachednow also checks that the fail-open run gets an empty stdin.< /dev/nullis gone. The README examples (file and saas) now run with sh's stdin on a pipe and assert an empty stderr.Stdio::null()line removed, both new tests fail within 5 s, with "the command waited on ck's stdin" and "ck hung on its stdin". They do not hang.cargo fmt --check,cargo clippy --all-targets -D warnings,cargo test --locked(17 unit, 41 run, 15 saas, 1 readme) andcargo +1.85 checkall pass locally.