nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] Invalid UTF-8 in ACP agent breaks Biome checks

Open yunuschoudhurywork-lang opened this issue 1 month ago • 4 comments

Description

The source file "source/acp/acp-agent.ts" appears to contain an invalid UTF-8 byte sequence, causing Biome to fail when processing the file.

Use Case

Developers should be able to run Biome checks, linting, and formatting commands without encountering encoding-related errors in the source code.

Proposed Solution

Investigate the invalid UTF-8 byte sequence in "source/acp/acp-agent.ts" and correct the encoding issue so that Biome can process the file successfully.

Alternatives Considered

No alternatives have been investigated yet.

Additional Context

TypeScript typechecking passed in the same environment, but the lint and format checks encounter the encoding error.

The same error also appears when running "pnpm run test:lint" and "pnpm run test:format".

Potential Solution

Inspect the affected bytes in "source/acp/acp-agent.ts", identify the invalid byte sequence, and replace or correct it while preserving the intended source code.

Implementation Notes (Optional)

  • OS: Windows
  • Biome CLI: 2.5.13
  • Reproduction command: "pnpm exec biome check source/acp/acp-agent.ts"
  • Reported error: "stream did not contain valid UTF-8"

Acceptance Criteria

  • "source/acp/acp-agent.ts" uses valid UTF-8 encoding.
  • "pnpm exec biome check source/acp/acp-agent.ts" completes without the encoding-related internal I/O error.
  • "pnpm run test:lint" and "pnpm run test:format" no longer fail because of this encoding issue.

yunuschoudhurywork-lang avatar Oct 20 '26 09:10 yunuschoudhurywork-lang

Hey @yunuschoudhurywork-lang, thanks for opening this! Could you edit the issue to follow our issue template?

addyCooks avatar Oct 27 '26 05:10 addyCooks

@akramcodez @addyCooks bro any update about this? do let me know so i can continue.

yunuschoudhurywork-lang avatar Nov 04 '26 16:11 yunuschoudhurywork-lang

I looked into this. On current main, source/acp/acp-agent.ts is valid UTF-8 and biome check passes on it, so I could not reproduce the Biome failure from the report (it may be stale or specific to a local checkout).

While checking every tracked text file for invalid UTF-8 I found one: source/app/prompts/sections/task-approach-nano-architect.md has a single 0x97 (Windows-1252 em dash) byte in its heading, so the nano + architect system prompt contains a U+FFFD replacement character. I'm picking that up and will open a small PR that references this issue without claiming to close it.

emreocell avatar Nov 17 '26 15:11 emreocell

Thanks for the report, @yunuschoudhurywork-lang. It was real: source/acp/acp-agent.ts had invalid UTF-8 bytes (a mangled em dash, 0x9d) at the time you opened this. It was fixed the next day in #1874 and is included in v1.32.0. On current main every tracked text file is valid UTF-8.

#2284 fixed a separate invalid byte in task-approach-nano-architect.md, which was found while looking at this.

Closing as completed. If you still see the Biome error on a fresh checkout of main, comment here with the file name and Biome version and we'll reopen it.

addyCooks avatar Nov 23 '26 06:11 addyCooks