Skip to content

sponsored-agent.test.ts fails with ENOENT: its Desktop drift check reads a file this export omits #1468

Description

@aniruddhaadak80

What happens

cli/src/utils/__tests__/sponsored-agent.test.ts reads

  • freebuff-desktop/src/server/services/sponsored-run.ts

via readFileSync in the the mirrored in-place guidance block. The file's own
header comment explains that DESKTOP_IN_PLACE_SPONSORED_GUIDANCE lives in the
Desktop orchestrator and is copied into the CLI rather than imported, and that
the copy is "read back out of the production file as TEXT, so a copy that stops
matching fails here rather than in a run the two surfaces told different things".

freebuff-desktop/ is not part of the public export (CONTRIBUTING.md in-scope
paths: cli/, sdk/, common/, agents/, packages/*, freebuff/ excluding
the private web app, scripts/tmux/, public docs). The path does not exist here.

Repro

$ bun test cli/src/utils/__tests__/sponsored-agent.test.ts

Result on main (0cd284b):

error: ENOENT: no such file or directory, open
'...\freebuff-desktop\src\server\services\sponsored-run.ts'

 0 pass
 1 fail

Why it was not caught

.github/workflows/ci.yml builds the SDK, builds the binary and smoke-tests it.
It never runs bun test, so this file is red on main and CI is green.

Why it matters

The whole point of the block is drift detection between the CLI copy and
Desktop's source. In the public mirror the check cannot run, so it provides zero
protection while still being the first thing to fail when someone runs the CLI
suite. Skipping only the case that reads an omitted file keeps the rest of the
suite's signal trustworthy.

Environment

  • Bun 1.3.14 (.bun-version)
  • main at 0cd284b
  • Fails identically on Linux and macOS: the path is absent from the export on
    every platform, so this is not a platform artifact.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions