GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(gui-extensions): WSL discovery still returns a banner line ending in the managed suffix when discoverScript prints nothing — frame the discovery output · Issue #345 · developing-today-forks/opencode

fix(gui-extensions): WSL discovery still returns a banner line ending in the managed suffix when discoverScript prints nothing — frame the discovery output #345

New issue
Copy link
New issue
Copy link
Closed
#346
Closed
fix(gui-extensions): WSL discovery still returns a banner line ending in the managed suffix when discoverScript prints nothing — frame the discovery output#345
#346
Copy link
Labels
app/gui-extensionsPackage: gui-extensions (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)

Description

@dezren39
dezren39
opened on Oct 23, 2026
Issue body actions

Finding

PR #342 (#342, commit 12cd6af1b899c15ba6c0b5ee3468cce4ff72f67b, merge a97969cdc039af22387417f20cd99e5844363465) narrowed parseDiscoveredCli to lines ending in /.opencode/bin/opencode. That closes #340 for banner paths outside the managed location, but the residual case is the same shape as #340: when discoverScript() prints nothing — the managed CLI is not installed — a login-shell banner/MOTD/profile line that itself ends in the managed suffix is still returned as the discovered CLI. The parser's own comment (packages/gui-extensions/src/wsl/runtime.ts:88-100) states the underlying problem: "No ordering rule can tell such a banner line from the script's own line when the script prints nothing". A suffix rule has the same limitation — it can only distinguish banner lines that do not look exactly like the one path the script can print.

Evidence (verified on current main b82506e82bd2b02ef0a3b5610a5b2986320e4993)

  • packages/gui-extensions/src/wsl/runtime.ts:100 (on main): .findLast((line) => line.startsWith("/") && line.endsWith("/.opencode/bin/opencode")) ?? null
  • packages/gui-extensions/src/wsl/remote-cli.ts:14-19 (on main): discoverScript() prints the path with printf '\n%s\n' "$cli" — a leading newline puts it on its own line, but there is no framing marker (unlike versionScript in the same file, which frames its output with OPENCODE_CLI_VERSION_BEGIN/END for exactly this reason, and unlike the SSH registration frame OPENCODE_SSH_REGISTRATION_BEGIN/END).
  • Reproduction with the real functions and the real discoverScript through sh, mirroring PR fix(gui-extensions): WSL discovery requires the managed CLI path suffix #342's own runDiscoverScriptWithoutCli harness (empty HOME = no CLI installed):
    • parseDiscoveredCli("/home/other/.opencode/bin/opencode\n") returns "/home/other/.opencode/bin/opencode" instead of null
    • Real-script run, no CLI installed, preceding output /home/other/.opencode/bin/opencode\n: parsed result is "/home/other/.opencode/bin/opencode"; with no preceding output the same harness correctly returns null.
  • PR fix(gui-extensions): WSL discovery requires the managed CLI path suffix #342's new tests cover only banner paths that do not end in the managed suffix (/opt/old-opencode/bin/opencode, /usr/local/bin/opencode, /opt/opencode — packages/gui-extensions/src/wsl/runtime.test.ts); no test covers a banner line ending in /.opencode/bin/opencode.
  • Baseline this run: focused bun test src/wsl/runtime.test.ts src/wsl/remote-cli.test.ts passes 20 / 1 skip / 0 fail on main, so this is an uncovered case, not a test regression.

Why it matters

resolveCli (runtime.ts:377) feeds inspectCli in packages/gui-extensions/src/wsl/servers.ts:92 (reports a CLI present and reads a version from the banner-named path) and startWslSidecar in packages/gui-extensions/src/wsl/sidecar.ts:31 — which throws error.opencodeNotInstalled only when discovery returns null, and otherwise execs the returned path as the server binary. A banner-advertised managed-suffix path (e.g. a profile/MOTD line naming another install location) therefore turns the not-installed case into a present-CLI report and an attempt to execute whatever binary sits at that banner-named path, instead of the clean not-installed flow. This is the remaining instance of the banner-invention class that #265/#272/#276 (parseVersion, fixed by framing), #334/#340 (this parser) have been closing one narrowing at a time; framing closes it for good rather than narrowing it further.

Scope: WSL only. The SSH discoverScript's output path is consumed inside the remote script itself ($cli), not parsed from stdout, and SSH registration output is already framed — no SSH change is implied. parseDiscoveredCli/discoverScript (WSL) exist only in this repo (grep of code/openchamber/nix clones: no hits) — no cross-repo port owed.

Acceptance criteria

  • discoverScript() frames its output (e.g. BEGIN/END markers on their own lines, following the versionScript pattern in the same file, including the marker-gluing cases fixed for the version frame), and parseDiscoveredCli accepts only a framed path.
  • With no CLI installed, preceding login-shell output that is a line ending in /.opencode/bin/opencode (including the exact $HOME/.opencode/bin/opencode spelling for a different/empty HOME) returns null — verified through the real discoverScript harness, terminated and unterminated preceding output.
  • The real discovered path is still returned when it follows banner output, including banner output with no trailing newline.
  • Ablation: with the parser/script change reverted, the new banner-suffix tests fail; restored, the focused wsl tests and the full gui-extensions suite pass, and package typecheck is clean.

Activity

  1. dezren39
    closed this as completedin #346on Oct 23, 2026
  2. dezren39
    added a commit that references this issue on Oct 23, 2026

    docs(roadmap): record the #343 and #345 completions in Done (#347) (#348

    227b47a
  3. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    developing-today-fleetBot
    on Nov 24, 2026 – with developing.today fleet
    More actions

    AUDIT-7 Lane 2 slice 3 — closing evidence. Verified against the issue body and merged implementation PR(s):

    • PR #346 — fix(gui-extensions): frame WSL CLI discovery output (merged 2026-10-23)

    The issue had zero comments in the fresh pre-action read; this comment records the missing close evidence.

  4. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    app/gui-extensionsPackage: gui-extensions (pkgs/ or apps/ in this repo)
    on Nov 25, 2026
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

    app/gui-extensionsPackage: gui-extensions (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.