Skip to content

Read the example package by a path the host accepts, not a URL pathname - #394

Merged
davidmckayv merged 3 commits into
CopilotKit:mainfrom
kevin9327:fix/file-url-to-path
Sep 6, 2026
Merged

Read the example package by a path the host accepts, not a URL pathname#394
davidmckayv merged 3 commits into
CopilotKit:mainfrom
kevin9327:fix/file-url-to-path

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

What this changes

Two tests read the fintech example through new URL(...).pathname, which is not a path on Windows:

const packageDir = new URL("../../examples/fintech", import.meta.url).pathname;

A file: URL's pathname keeps its leading separator and its URL escaping, so on Windows that is
/C:/Users/... rather than C:\Users\..., and the read fails:

ENOENT: no such file or directory, open '/C:/Users/.../openbot/examples/fintech/skills.yaml'
      at app/tests/skill-creator-slug.test.ts:20:23

ENOENT: no such file or directory, open '\C:\Users\...\openbot\examples\fintech\brand.yaml'
      at loadTenantPackage (server/src/tenant-package.ts:533:34)

fileURLToPath is the conversion that handles the drive letter, the separators and any escaped
character. The other nine import.meta.url sites in the repository are already fine: they hand the
URL straight to readFileSync, which does the conversion itself. Only these two took .pathname.

CI runs on Linux, where the pathname happens to be a usable path, so neither failure is visible
there. A contributor on Windows sees them on the first bun test.

Where it runs

  • New state that outlives a request? None. Test files only.
  • What happens on the second replica? Nothing; no shipped code changes.
  • Anything serialised? No.
  • Anything fanned out to a browser? No.
  • New listener, port, or schedule? None.

Boundary and audit

  • Every acting call still goes through the gateway: untouched.
  • New refusals and new failures each write a row: no new outcomes.
  • Nothing new is trusted from the client: no runtime change.

Changelog

  • No entry: a deployment behaves no differently afterwards. This is two test files reading the
    same fixture by a path the host accepts.

Proof

On Windows 11, bun test app/tests before and after:

before   319 pass, 1 fail, 1 error
after    322 pass, 0 fail

The three extra passes are the file that could not be collected at all, since the read is at module
scope. And the server test that hits the same conversion:

bun test server/tests/tenant-package.test.ts -t "loads the mounted fintech package without a theme file"
before   0 pass, 1 fail   (ENOENT on brand.yaml)
after    1 pass, 0 fail

bun run typecheck passes in all four workspaces, and bunx biome check is clean on both files.

The rest of server/tests still needs a Postgres this machine does not have, so those failures are
unrelated and unchanged.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep-reviewed against live code (correctness, governance, no vendor/secret/scale issues). Composed build+tests green. CHANGELOG/format rebase on CI-validated substance.

@davidmckayv
davidmckayv merged commit 1a021ee into CopilotKit:main Sep 6, 2026
14 checks passed
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