Skip to content

agent-chat: add DOM.AsyncIterable to tsconfig lib so bun run check passes - #12201

Open
Somuuuu007 wants to merge 1 commit into
manaflow-ai:mainfrom
Somuuuu007:agent-chat-tsconfig-dom-asynciterable
Open

agent-chat: add DOM.AsyncIterable to tsconfig lib so bun run check passes#12201
Somuuuu007 wants to merge 1 commit into
manaflow-ai:mainfrom
Somuuuu007:agent-chat-tsconfig-dom-asynciterable

Conversation

@Somuuuu007

@Somuuuu007 Somuuuu007 commented Sep 9, 2026

Copy link
Copy Markdown

What's broken

bun run check in agent-chat/ fails at its first step, bun x tsc --noEmit:

adapters/lines.ts(10,31): error TS2504: Type 'ReadableStream<Uint8Array<ArrayBufferLike>>' must have a '[Symbol.asyncIterator]()' method that returns an async iterator.

Because it fails there, none of the ten test suites the script chains after it run at all.

Why

readLines() in adapters/lines.ts consumes a child process stdout stream with for await (const chunk of stream).

TypeScript 5.6 moved ReadableStream's async iterator declaration out of DOM and into a separate DOM.AsyncIterable lib. agent-chat/tsconfig.json lists ["ES2022", "DOM", "DOM.Iterable"], so the DOM ReadableStream type 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.AsyncIterable to the lib array. One line, no source changes.

Verification

bun run check before the change: fails immediately on TS2504.
After: tsc is clean and all ten suites pass, exit code 0.

claude independent-launch environment assertions passed
model label prettifier: OK
model picker loading indicator: OK
activity indicator state: OK
keymap dispatch assertions passed
options store assertions passed
options UI labels: OK
turn summary and virtualization: OK
selection CSS policy: OK
highlight assertions passed

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.

  1. CI doesn't run this script. ci.yml runs only bun test/claude-environment.test.ts in agent-chat, so bun run check — and the tsc step in particular — is never exercised on CI. That's why this went unnoticed.
  2. typescript isn't pinned. It isn't in agent-chat/package.json devDependencies, so bun x tsc resolves whatever is newest at run time and the check's behavior can shift under you.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Low Risk
Single compiler lib entry change with no runtime or application logic changes.

Overview
Adds DOM.AsyncIterable to agent-chat/tsconfig.json so TypeScript recognizes async iteration on DOM ReadableStream types (needed since TS 5.6 split that typing out of DOM).

This unblocks bun run check, which was failing at tsc --noEmit with TS2504 on for await in readLines() (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 check in agent-chat by adding DOM.AsyncIterable to the tsconfig lib array. bun x tsc --noEmit failed with TS2504 because TypeScript 5.6 moved ReadableStream's async iterator declaration into DOM.AsyncIterable; without it the type check errors and the ten test suites chained after it never run. With the lib added, tsc stays clean and all suites pass.

Written for commit bb23edf. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved TypeScript support for asynchronous DOM iteration in the application.

@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

@Somuuuu007 is attempting to deploy a commit to the Manaflow Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: bd92b9b8-436d-40f7-8609-2ea89e02fc5e

📥 Commits

Reviewing files that changed from the base of the PR and between e15f81c and bb23edf.

📒 Files selected for processing (1)
  • agent-chat/tsconfig.json

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The TypeScript configuration now includes DOM.AsyncIterable in the compiler library list.

Changes

TypeScript configuration

Layer / File(s) Summary
Compiler library declarations
agent-chat/tsconfig.json
The compilerOptions.lib array now includes DOM.AsyncIterable alongside ES2022, DOM, and DOM.Iterable.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to bb23e

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)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the package, the specific configuration change, and the reason for the change. It accurately summarizes the primary pull request objective.
Description check ✅ Passed The description explains what changed, why it was needed, and how it was verified. It includes the compiler error, the configuration fix, test results, and platform context. The review trigger and che…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PASS: The pull request changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable to the TypeScript lib array. The commit diff contains no Swift files or Swift declarations. Therefore, it d…
Cmux Swift Blocking Runtime ✅ Passed PASS: The commit changes only agent-chat/tsconfig.json by adding DOM.AsyncIterable. It changes no Swift files and introduces no blocking or timing synchronization primitive. The custom check appli…
Cmux Browser Automation Off-Main ✅ Passed PASS: The pull request changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable to compilerOptions.lib. The diff contains no browser.* command, WebKit/AppKit access, worker routing, mai…
Cmux Expensive Synchronous Load ✅ Passed PASS: The pull request changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable to the TypeScript lib array. The commit contains no Swift file changes and no agent-history load or interac…
Cmux Cache Substitution Correctness ✅ Passed PASS: The pull-request diff changes only agent-chat/tsconfig.json. It adds DOM.AsyncIterable to the TypeScript lib list and changes no Swift, TypeScript, or JavaScript persistence, history, undo…
Cmux No Hacky Sleeps ✅ Passed PASS: The pull request changes only agent-chat/tsconfig.json by adding DOM.AsyncIterable to the TypeScript lib array. The diff introduces no sleep, timer, delay, polling, retry, or wall-clock wa…
Cmux Algorithmic Complexity ✅ Passed PASS. The pull request changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable to the compiler lib list. The exact diff contains no Swift, TypeScript, JavaScript, shell, or runtime algor…
Cmux Swift Concurrency ✅ Passed PASS: The pull-request commit changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable. The exact commit diff contains no Swift files or Swift code, so it introduces none of the listed lega…
Cmux Swift @Concurrent ✅ Passed PASS: The pull request changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable to the TypeScript lib array. The commit diff contains no Swift files, Swift functions, isolation annotation…
Cmux Swift Package Boundaries ✅ Passed PASS: The pull request changes only agent-chat/tsconfig.json by adding DOM.AsyncIterable. The committed diff contains no Swift files or production Swift changes, so the Swift package boundary rule…
Cmux Swiftpm Lockfiles ✅ Passed PASS. The commit changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable to the TypeScript lib list. It changes no Package.swift, Package.resolved, Xcode project, .gitignore, workf…
Cmux Swift Logging ✅ Passed PASS: The pull request changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable to the TypeScript lib array. The diff contains no Swift files and adds no logging statements, so the Swift …
Cmux User-Facing Error Privacy ✅ Passed PASS: The pull request changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable to the TypeScript lib array. It adds or changes no user-facing errors, alerts, command output, API bodies, …
Cmux Full Internationalization ✅ Passed PASS. The pull request changes only agent-chat/tsconfig.json, adding the compiler library token DOM.AsyncIterable. The diff introduces no Swift text, string catalog, web UI, metadata, API response…
Cmux Swiftui State Layout ✅ Passed PASS: The pull request changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable to the TypeScript lib array. The parent-to-HEAD diff has no SwiftUI files, state declarations, layout code,…
Cmux Architecture Rethink ✅ Passed PASS: The pull request changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable to the TypeScript lib array. The parent-to-HEAD diff contains no Swift files, Swift lifecycle code, timing …
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS: The pull request commit changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable. Its exact patch contains no Swift, NSWindow, NSPanel, NSWindowController, Window, `WindowGrou…
Cmux Source Artifacts ✅ Passed PASS. The actual pull-request commit changes only agent-chat/tsconfig.json, a hand-written TypeScript configuration file. The one-line change adds DOM.AsyncIterable to the existing lib array. It…
Cmux No Test Or Debug Seam In Production Source ✅ Passed The pull request changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable to the TypeScript lib array. The diff contains no Swift files under a production Sources/ path, no #if DEBUG
Cmux No Ambient Global State ✅ Passed PASS: The pull request changes only agent-chat/tsconfig.json, adding DOM.AsyncIterable to the TypeScript lib array. The exact diff contains no Swift files or Swift declarations. The custom check…
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Some tools did not complete. Review the errors below.

🔧 Biome (2.5.8)
agent-chat/tsconfig.json

Biome 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Somuuuu007

Copy link
Copy Markdown
Author

I have read the CLA Document v2.2 and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Sep 9, 2026
…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>
@Somuuuu007
Somuuuu007 force-pushed the agent-chat-tsconfig-dom-asynciterable branch from 83b9e49 to bb23edf Compare September 9, 2026 05:12
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

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.

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