Skip to content

Misleading Go checker warning when OpenCode process PATH misses Homebrew go #47

@Suknna

Description

@Suknna

Summary

AFT reports that the Go checker is not installed when the user's macOS system has Go installed, but the OpenCode/AFT process PATH does not include Homebrew's bin directory.

The warning currently reads:

AFT: ⚠️ Checker is not installed (language: go, tool: go)
go is configured in go.mod but not installed. Install Go from https://go.dev/dl/.

This is misleading in the common macOS case where Go is installed at /opt/homebrew/bin/go, but OpenCode is launched from a GUI / non-login environment whose PATH omits /opt/homebrew/bin.

Environment

  • OS: macOS arm64
  • OpenCode: 1.15.6
  • AFT CLI / plugin: 0.27.1
  • Go: installed and available in interactive shell

Interactive shell:

command -v go
go version

Observed output:

/opt/homebrew/bin/go
go version go1.26.1 darwin/arm64

Reproduction

  1. Install Go through Homebrew on macOS arm64, so the binary is at /opt/homebrew/bin/go.
  2. Launch OpenCode from an environment whose PATH does not include /opt/homebrew/bin.
  3. Open/edit a Go project with go.mod so AFT auto-detects the Go checker.
  4. Trigger AFT validation/checking.

A minimal local simulation of the process environment shows the issue:

env -i HOME="/Users/suknna" PATH="/usr/bin:/bin:/usr/sbin:/sbin" \
  node -e 'const {spawnSync}=require(node:child_process); const r=spawnSync(go,[version],{encoding:utf8}); console.log({status:r.status,error:r.error&&r.error.code,path:process.env.PATH})'

Output:

{ status: null, error: 'ENOENT', path: '/usr/bin:/bin:/usr/sbin:/sbin' }

Adding /opt/homebrew/bin to that same process PATH makes go version work.

Actual behavior

AFT says Go is not installed and suggests installing Go from https://go.dev/dl/.

Expected behavior

AFT should make it clear that the checker binary was not found in the AFT/OpenCode process PATH, not necessarily that Go is absent from the operating system.

Possible improvements:

  • Include the current process PATH in the warning or debug details.
  • Say go was not found in the AFT/OpenCode process PATH instead of go is configured in go.mod but not installed.
  • On macOS, hint that Homebrew Go is commonly installed under /opt/homebrew/bin or /usr/local/go/bin and that GUI-launched apps may not inherit login-shell PATH.
  • If applicable, surface this through doctor lsp / checker diagnostics in the same style as existing binary-resolution output.

Related context checked

I searched existing open/closed issues and current release notes before filing:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions