Skip to content

A NUL in a bare launcher command name reports 'not found on PATH' instead of ArgumentException #400

Closed

Description

@Blind-Striker

What. OpenCodeServer.StartAsync's XML doc promises an ArgumentException for "a NUL in a command entry". For a bare command name (one resolved on PATH) that contains NUL, the PATH resolution runs before the strategy's NUL check (WindowsServerChild/PosixServerChild, the NulText.Occurs refusal). The caller therefore gets the resolution failure, an OpenCodeServerException saying the command was not found on PATH, instead of the documented ArgumentException. A rooted command reaches the NUL check and is refused as documented.

Where. src/OpenCode.Sdk/Hosting/Launcher/OpenCodeServer.Launcher.cs (the doc's <exception cref="ArgumentException">), and the resolution order ahead of WindowsServerChild.cs / PosixServerChild.cs' NUL refusal.

Evidence. Found by reading the code, not run. The fix's red test confirms it first.

Fix. Validate NUL once, before resolution, on every command entry. RT-E6 step 2's ChildCommand ("one NUL/blank check") is the planned home, and this issue is its red→green case. Found during the RT-E6 characterization inventory (internal faz4/RT-E6/characterization-inventory.md §5.2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions