Skip to content

Replace hand-rolled stream handling with Node stream built-ins - #1566

Merged
cristianrgreco merged 1 commit into
mainfrom
claude/stream-built-ins
Oct 12, 2026
Merged

cristianrgreco merged 1 commit into
mainfrom
claude/stream-built-ins

Conversation

@cristianrgreco

Copy link
Copy Markdown
Collaborator

Summary

Follows the k3s change in #1503 and replaces the remaining hand-rolled stream collection with node:stream/consumers and node:stream/promises.

  • runInContainer reads the container output with text().
  • putArchive no longer drains the dockerode response. dockerode 5 buffers it before resolving, so the drain was a no-op.
  • streamToString is removed, as those were its only two callers.
  • The HTTP wait strategy reads the last logs with text(). A log stream error is now caught by the existing catch.
  • Selenium's saveRecording extracts the archive with pipeline(), so a corrupt archive or a failed source stream rejects instead of hanging.

Verification

  • npm run format, npm run lint, npm run knip, npm run check-compiles: pass.
  • npx vitest run on run-in-container.test.ts, http-wait-strategy.test.ts and generic-container.test.ts: 69 passed, 1 skipped.
  • npx vitest run packages/modules/selenium/src/selenium-container.test.ts: 6 passed.
  • A standalone script confirmed pipeline(source, tar.extract(dest)) extracts a tar-fs archive and rejects on a corrupt archive and on a source error.

Not breaking

streamToString was internal and never exported from the package index.ts. The HTTP wait strategy error message keeps its format; the logs are now trimmed as a whole instead of per chunk.

@cristianrgreco cristianrgreco added maintenance Improvements that do not change functionality patch Backward compatible bug fix labels Oct 12, 2026
@cristianrgreco
cristianrgreco merged commit 8b50145 into main Oct 12, 2026
191 checks passed
@cristianrgreco
cristianrgreco deleted the claude/stream-built-ins branch October 12, 2026 18:22
cristianrgreco added a commit that referenced this pull request Oct 13, 2026
Resolve conflicts with #1514 and #1566: keep the remaining-startup-budget timeouts from main on the Couchbase polls, drop the removed streamToString export, and move waitUntilKvAcceptsCredentials to poll, passing its signal to container.exec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Improvements that do not change functionality patch Backward compatible bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant