agent-chat: add DOM.AsyncIterable to tsconfig lib so bun run check passes - #12201
agent-chat: add DOM.AsyncIterable to tsconfig lib so bun run check passes#12201Somuuuu007 wants to merge 1 commit into
Conversation
|
@Somuuuu007 is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
|
All contributors have signed the CLA ✍️ ✅ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe TypeScript configuration now includes ChangesTypeScript configuration
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This change restores TypeScript declarations required for async iteration of DOM streams and allows the agent-chat checks to compile successfully. No current merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 Biome (2.5.8)agent-chat/tsconfig.jsonBiome could not lint this file: nested root configuration. Check the repository's Biome configuration and plugins. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I have read the CLA Document v2.2 and I hereby sign the CLA |
…sses
`bun run check` fails at its first step, `bun x tsc --noEmit`:
adapters/lines.ts(10,31): error TS2504: Type 'ReadableStream<Uint8Array>'
must have a '[Symbol.asyncIterator]()' method that returns an async iterator.
readLines() iterates a child process stdout stream with `for await`.
TypeScript 5.6 moved ReadableStream's async iterator declaration into the
separate DOM.AsyncIterable lib, which this tsconfig does not include, so the
DOM ReadableStream type has no [Symbol.asyncIterator] and the check cannot
pass on any current tsc.
Adding the lib leaves tsc clean and all ten test/*.ts suites in the check
script passing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
83b9e49 to
bb23edf
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
What's broken
bun run checkinagent-chat/fails at its first step,bun x tsc --noEmit:Because it fails there, none of the ten test suites the script chains after it run at all.
Why
readLines()inadapters/lines.tsconsumes a child process stdout stream withfor await (const chunk of stream).TypeScript 5.6 moved
ReadableStream's async iterator declaration out ofDOMand into a separateDOM.AsyncIterablelib.agent-chat/tsconfig.jsonlists["ES2022", "DOM", "DOM.Iterable"], so the DOMReadableStreamtype has no[Symbol.asyncIterator]and the check cannot pass on any current tsc.This is a config gap, not a platform issue — the lib file is the same on every OS.
Fix
Add
DOM.AsyncIterableto thelibarray. One line, no source changes.Verification
bun run checkbefore the change: fails immediately on TS2504.After:
tscis clean and all ten suites pass, exit code 0.Run on Windows with bun 1.3.14 and tsc 5.9.2. I don't have a macOS or Linux box to confirm there, but the cause is platform-independent.
Two related things I noticed, not changed here
Happy to send either as a follow-up if you want them.
ci.ymlruns onlybun test/claude-environment.test.tsinagent-chat, sobun run check— and thetscstep in particular — is never exercised on CI. That's why this went unnoticed.typescriptisn't pinned. It isn't inagent-chat/package.jsondevDependencies, sobun x tscresolves whatever is newest at run time and the check's behavior can shift under you.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Low Risk
Single compiler
libentry change with no runtime or application logic changes.Overview
Adds
DOM.AsyncIterabletoagent-chat/tsconfig.jsonso TypeScript recognizes async iteration on DOMReadableStreamtypes (needed since TS 5.6 split that typing out ofDOM).This unblocks
bun run check, which was failing attsc --noEmitwith TS2504 onfor awaitinreadLines()(adapters/lines.ts) and never reaching the chained test suites.Reviewed by Cursor Bugbot for commit bb23edf. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Fixes
bun run checkinagent-chatby addingDOM.AsyncIterableto the tsconfiglibarray.bun x tsc --noEmitfailed with TS2504 because TypeScript 5.6 movedReadableStream's async iterator declaration intoDOM.AsyncIterable; without it the type check errors and the ten test suites chained after it never run. With the lib added,tscstays clean and all suites pass.Written for commit bb23edf. Summary will update on new commits.
Summary by CodeRabbit