Skip to content

feat(interpreter): stream yes and seq into pipelines with SIGPIPE - #2566

Merged
chaliy merged 1 commit into
mainfrom
claude/streaming-generators
Oct 7, 2026
Merged

chaliy merged 1 commit into
mainfrom
claude/streaming-generators

Conversation

@chaliy

@chaliy chaliy commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Requested by Михайло · project thread

What changed

yes and seq stream into pipelines. As a producer stage they now run concurrently, like shell-code stages already did. They write 4 KiB chunks straight into the stage pipe through a new internal Context::stdout_stream(). When the reader is gone they stop with 141 (SIGPIPE).

The pipe goes only to the stage's own unredirected simple command, matched by address. Commands run from its arguments, a yes() {...} function and yes > file keep the buffered path.

Why

This is step 2 of the roadmap (streaming builtin I/O). The roadmap names seq 1e6 | head -1 and yes | head as the motivating cases. Both used to run to the output cap and print a truncation notice.

Before

$ seq 1000000 | head -1; echo "${PIPESTATUS[*]}"
1
seq: line limit (100000) exceeded; output truncated
1 0

After

1
141 0

yes | head -2 gives 141 0 and set -o pipefail; yes | head -1 exits 141, both as in bash. The new spec pipe-generators.test.sh matches real bash. The L-PIPE-001 evidence now uses cat big | head -1, which still runs to completion.

Risk

Low to medium.

  • It reuses the existing bounded pipe and its nesting cap (TM-DOS-124).
  • The output caps still apply when the reader takes everything (yes | wc -l).
  • Each chunk charges budget work.

Checklist

  • Failing spec first, compared with bash
  • lib + integration tests, clippy, fmt
  • knowledge (parallel-execution, limitations, log)

https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA


Generated by Claude Code

@chaliy chaliy self-assigned this Oct 7, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit f61f2f4 Commit Preview URL

Branch Preview URL
Oct 07 2026, 05:26 PM

@chaliy
chaliy force-pushed the claude/streaming-generators branch 5 times, most recently from 8e8fede to e7c274c Compare October 7, 2026 16:41
@chaliy
chaliy force-pushed the claude/streaming-generators branch from e7c274c to f61f2f4 Compare October 7, 2026 17:26
@chaliy
chaliy merged commit 1b36ca2 into main Oct 7, 2026
44 checks passed
@chaliy
chaliy deleted the claude/streaming-generators branch October 7, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant