Skip to content

Conversation

Copy link

Copilot AI commented Jan 21, 2026

TypeScript 5.9.3 sends multiple tsserver protocol messages in a single stdout chunk. The test harness parser assumed one message per chunk, causing JSON parse failures.

Changes

Rewrote the protocol parser in test/util/lang-server.ts:

  • Buffer management: Accumulate data across chunks, process all complete messages
  • Content-Length parsing: Use regex to properly delimit messages: /Content-Length: (\d+)\r?\n\r?\n/
  • Extracted method: Message processing logic moved to #processMessages() for clarity

Before:

const obj = JSON.parse(data.split('\n', 3)[2]);
// Fails when multiple messages arrive in one chunk

After:

#processMessages() {
  let headerMatch = this.buffer.match(/Content-Length: (\d+)\r?\n\r?\n/);
  while (headerMatch && headerMatch.index !== undefined) {
    // Extract and process each complete message
    // Remove from buffer, continue with next
  }
}

All 10 tests passing.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • devblogs.microsoft.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

The branch arthurfiorette/serena has failing unit tests at @packages/ts-html-plugin. Run pnpm build first to build the whole monorepo and then run pnpm test inside the packages/ts-html-plugin first to detect what is going on. This happened once i upgraded the typescript version to a new one. You can enable the debug mode and read the written tsserver log (read packages/ts-html-plugin/test/util/lang-server.ts to understand more). Once you managed to fix what was broken in the ts plugin, open a PR fixing it (you will know that its fixed once all tests start passing again)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2026

⚠️ No Changeset found

Latest commit: eff90c9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI and others added 2 commits January 21, 2026 19:11
Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>
Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing unit tests in ts-html-plugin Fix tsserver protocol parser for TypeScript 5.9.3 Jan 21, 2026
Copilot AI requested a review from arthurfiorette January 21, 2026 19:16
@arthurfiorette arthurfiorette marked this pull request as ready for review January 22, 2026 02:16
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0830fee) to head (eff90c9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #455   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          434       434           
=========================================
  Hits           434       434           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arthurfiorette arthurfiorette merged commit d7f1ad6 into master Jan 22, 2026
11 checks passed
arthurfiorette added a commit that referenced this pull request Jan 22, 2026
Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
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