Skip to content

fix(github): give TextDecoder both options Workers' types require - #780

Open
kixelated wants to merge 1 commit into
mainfrom
fix/worker-text-decoder
Open

kixelated wants to merge 1 commit into
mainfrom
fix/worker-text-decoder

Conversation

@kixelated

@kixelated kixelated commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

quest/github runs in Workers, but decodeCursor in src/github/wait.ts builds new TextDecoder("utf-8", { fatal: true }). Cloudflare's Workers types declare TextDecoderConstructorOptions with both fatal and ignoreBOM required, so a Worker that imports quest/github (kixel-ai/kixel.quest, bumping to v0.22.0) fails tsc:

node_modules/quest/src/github/wait.ts(663,41): error TS2741: Property 'ignoreBOM' is missing in type '{ fatal: true; }' but required in type 'TextDecoderConstructorOptions'.

tsc -p src/github here checks against the WebWorker lib, where ignoreBOM is optional, so it did not catch this.

Change

Pass ignoreBOM: false, the default, so behavior is unchanged. src/cli already passes both options.

Not done: checking src/github against @cloudflare/workers-types here, which would catch the next one but adds a dev dependency for one line; open to it if preferred.

Validation

  • bun run check (tsc for root, core, github; prettier) passes.
  • vitest run test/wait.test.ts: 72 passed.
  • kixel.quest's tsc with this commit pinned no longer reports the error (see kixel-ai/kixel.quest#75).

Public API and wire: none.

Models

Size: XS
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, XS, arm B)

🤖 Generated with Claude Code

(Written by Opus 5.5)

Review

Rewritten by quest review after each round.

  • Head: df03c9a

  • Base: origin/main at 80cd2c8

  • Risk: low, Explicitly setting ignoreBOM to its existing default of false preserves cursor decoding behavior for quest/github consumers, and a revert fully undoes the change.

  • Classified: low by Codex, gpt-6.1-sol, low effort, session 01a1ec42-95ca-7c51-869e-da3f31c7d8fa

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1ec42-ab83-7bf0-8f4c-5e4445148ecc, round 1

  • Score: 10/10, Explicitly setting ignoreBOM to its existing default of false preserves decoding behavior, with no regressions identified by code inspection.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

  • Reviewer: Codex, gpt-6.1-sol, low effort, shadow

  • Session: 01a1ec42-ab83-7831-96be-3c97ebb1826e, round 1

  • Score: 10/10, Explicitly setting ignoreBOM to false preserves TextDecoder's default behavior while satisfying the required options type, with no apparent behavioral regression.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

decodeCursor now sets ignoreBOM to false when it configures TextDecoder for fatal UTF-8 decoding. Invalid UTF-8 continues through the existing error path to an InputError.

Merge Risk: Minimal · up to df03c

This is a one-option type-compatibility fix that preserves the existing cursor decoding behavior. It is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: adding ignoreBOM to the TextDecoder options in the github module to satisfy Workers types. It matches the changeset (wait.ts, +3/-1) and states the main point.
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.
Description check Passed The description states the problem (Workers TypeScript types require the ignoreBOM option on TextDecoder in decodeCursor in src/github/wait.ts), the change (passing ignoreBOM: false), and validation s…
Full details: Description check

Explanation

The description states the problem (Workers TypeScript types require the ignoreBOM option on TextDecoder in decodeCursor in src/github/wait.ts), the change (passing ignoreBOM: false), and validation steps (bun run check, vitest run test/wait.test.ts, kixel.quest tsc). It matches the raw summary and PR objectives, so it is related to the changeset and is not off-topic or vague.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 88f773bc-b6f0-4ba4-9421-d9d213af0036
Commits

Reviewing files that changed from the base of the PR and between 80cd2c8 and df03c9a.

Files selected for processing: 1

  • src/github/wait.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@pullfrog

pullfrog Bot commented Nov 18, 2026

Copy link
Copy Markdown

No configured credential can serve this run. Your Claude subscription has hit its usage limit, which resets at 2026-11-18 06:00 UTC. Re-trigger after it resets, or add an API key for this provider, which Pullfrog falls back to automatically.

The providers' responses
CLAUDE_CODE_OAUTH_TOKEN: 429: This request would exceed your account's rate limit. Please try again later.

Pick another model →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using claude-sonnet-5-5

@kixelated

kixelated commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator Author

Settled with the maintainer: no typecheck of src/github against @cloudflare/workers-types. A dev dependency and CI step isn't worth it for a one-off, one-line mismatch; kixel.quest's quest bumps catch the next one.

(Written by Claude Opus 5.5 with high effort)

This branch has not been deployed

No deployments
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