Skip to content

fix: Fix CI build errors - ESM modules and test failures#5

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-ci-build-errors
Draft

fix: Fix CI build errors - ESM modules and test failures#5
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-ci-build-errors

Conversation

Copilot AI commented Jan 8, 2026

Copy link
Copy Markdown

CI was failing due to Jest ESM module loading issues and two test failures in copilot-service.ts.

Changes

  • package.json: Add NODE_OPTIONS='--experimental-vm-modules' to test script for ESM support (required by node-fetch v3+)

  • convertMessagesToCopilotPrompt: Fix message ordering - was grouping messages by role instead of preserving conversation order

// Before: grouped all users, then all assistants (broken)
return systemPrompt + userPrompts + assistantResponses + ...

// After: preserves message order
for (const message of messages) {
  result += formatMessage(message);
}
  • detectLanguageFromMessages: Fix regex to match file extensions followed by ? (e.g., file.cpp?)
// Before: /\.([a-zA-Z0-9]+)(?:\s|"|')/
// After:  /\.([a-zA-Z0-9]+)(?:\s|"|'|\?)/
Original prompt

fix all ci build errors


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

Co-authored-by: shyamsridhar123 <117464342+shyamsridhar123@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix all CI build errors fix: Fix CI build errors - ESM modules and test failures Jan 8, 2026
Copilot AI requested a review from shyamsridhar123 January 8, 2026 03:04
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