Skip to content

refactor(worker-utils): share bounded stream reader - #7228

Merged
johnnyeric merged 1 commit into
mainfrom
johnnyeric/bounded-stream-reader
Oct 8, 2026
Merged

johnnyeric merged 1 commit into
mainfrom
johnnyeric/bounded-stream-reader

Conversation

@johnnyeric

@johnnyeric johnnyeric commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Share session-ingest's existing readBoundedStream as @kilocode/worker-utils/bounded-stream-reader so the usage publisher can reuse its actual-byte limit handling. The implementation is byte-for-byte unchanged; the old session-ingest module re-exports the function and type, preserving callers, tests and queue configuration.

Verification

  • Synthetic local HTTP staging used the existing session function, real DO RPC and local R2/Queue: the exact 80-byte payload and exported SQLite snapshot matched.
  • Existing direct ingest preserved Unicode data and rejected malformed JSON and declared-byte overflow; staging rejected actual input above 4 MiB before another object or message was added.

The runtime fixture uses a temporary HTTP wrapper and consumer; it bypasses production Hono/auth, PostgreSQL metadata projection and the production consumer.

Visual Changes

N/A

Reviewer Notes

Existing reader/direct-ingest/staging/queue-consumer suites: 66 passed, 1 pre-existing skip. Six selected workerd Durable Object integration tests passed. Session-ingest and worker-utils typechecks, focused lint/formatting, and the session production dry run passed; the bundled reader matches the original source.

Publisher draft #7229 depends on this PR. This prerequisite is 3 files, +51/-46. No deployment was performed.

@johnnyeric
johnnyeric added this pull request to stack #7231 October 6, 2026 21:30
@johnnyeric
johnnyeric marked this pull request as ready for review October 6, 2026 22:48
@kilo-code-bot

kilo-code-bot Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Pure relocation of readBoundedStream into @kilocode/worker-utils/bounded-stream-reader; the implementation is byte-for-byte identical, the subpath export and workspace dependency are in place, and session-ingest re-exports through the shim so all existing callers and tests are unchanged.

Files Reviewed (3 files)
  • packages/worker-utils/package.json
  • packages/worker-utils/src/bounded-stream-reader.ts
  • services/session-ingest/src/ingest/bounded-stream-reader.ts
Previous Review Summaries (3 snapshots, latest commit 1cbdf52)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 1cbdf52)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Pure relocation of readBoundedStream into @kilocode/worker-utils/bounded-stream-reader; the implementation is byte-for-byte identical, the subpath export and workspace dependency are in place, and existing callers/tests import through the re-exporting shim so behavior is unchanged.

Files Reviewed (3 files)
  • packages/worker-utils/package.json
  • packages/worker-utils/src/bounded-stream-reader.ts
  • services/session-ingest/src/ingest/bounded-stream-reader.ts

Previous review (commit e88c79d)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Pure relocation of readBoundedStream into @kilocode/worker-utils/bounded-stream-reader; the new implementation is identical to the deleted one, the subpath export is registered in package.json, and the session-ingest module re-exports it so existing callers and tests are unaffected.

Files Reviewed (3 files)
  • packages/worker-utils/package.json
  • packages/worker-utils/src/bounded-stream-reader.ts
  • services/session-ingest/src/ingest/bounded-stream-reader.ts

Previous review (commit 6f1f2f4)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Pure relocation of readBoundedStream into @kilocode/worker-utils/bounded-stream-reader with the original session-ingest module re-exporting it; the moved implementation is byte-for-byte identical and the new export path resolves via the existing workspace dependency.

Files Reviewed (3 files)
  • packages/worker-utils/package.json
  • packages/worker-utils/src/bounded-stream-reader.ts
  • services/session-ingest/src/ingest/bounded-stream-reader.ts

Reviewed by deepseek-v4.1-flash · Input: 33K · Output: 3.8K · Cached: 197.9K

Review guidance: REVIEW.md from base branch main

@johnnyeric
johnnyeric force-pushed the johnnyeric/bounded-stream-reader branch from 6f1f2f4 to e88c79d Compare October 6, 2026 23:06
@johnnyeric
johnnyeric force-pushed the johnnyeric/bounded-stream-reader branch from 1cbdf52 to 1bb57cb Compare October 7, 2026 17:21
@johnnyeric
johnnyeric merged commit d053dcc into main Oct 8, 2026
88 of 89 checks passed
@johnnyeric
johnnyeric deleted the johnnyeric/bounded-stream-reader branch October 8, 2026 11:48
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.

2 participants