Skip to content

doctor says opencode not installed if first $PATH entry is a wrapper script #75

@HaleTom

Description

@HaleTom

Description

opencode is installed and in $PATH, but not at first entry

Doctor output

% bunx -g @cortexkit/magic-context@latest doctor
│
●  Detected OpenCode — using it for diagnose.
│
◇  Running doctor for OpenCode…
┌  Magic Context Doctor
│
■  OpenCode is not installed or not in PATH
│
└  Doctor failed — install OpenCode first

Environment

My $PATH's opencode is a wrapper that does stuff like mise variables, bunx update (backgrounded), bwrap, then opencode.

% which opencode
/home/ravi/bin/opencode

Suggested fix

This seems a valid use case. Maybe a loop through $PATH would satisfy the checker here?

Environment

  • Plugin: v0.19.0
  • OS: linux x64
  • Node: v24.14.1
  • OpenCode: not installed

Configuration

Config from ~/.config/opencode/magic-context.jsonc:

{
  "$schema": "https://raw.githubusercontent.com/cortexkit/opencode-magic-context/master/assets/magic-context.schema.json",
  "dreamer": {
    "enabled": true
  },
  "sidekick": {
    "enabled": true
  }
}

Diagnostics

  • Timestamp: 2026-05-14T16:08:05.777Z
  • Plugin: v0.19.0
  • OS: linux x64
  • Node: v24.14.1
  • OpenCode installed: false
  • Plugin registered in opencode config: true
  • Plugin registered in tui config: true
  • magic-context.jsonc parse error: none
  • Conflicts detected: none

Config paths

{
  "configDir": "~/.config/opencode",
  "opencodeConfig": "~/.config/opencode/opencode.jsonc",
  "opencodeConfigFormat": "jsonc",
  "magicContextConfig": "~/.config/opencode/magic-context.jsonc",
  "tuiConfig": "~/.config/opencode/tui.json",
  "tuiConfigFormat": "json",
  "omoConfig": null
}

magic-context.jsonc flags

{
  "$schema": "https://raw.githubusercontent.com/cortexkit/opencode-magic-context/master/assets/magic-context.schema.json",
  "dreamer": {
    "enabled": true
  },
  "sidekick": {
    "enabled": true
  }
}

Plugin cache

{
  "path": "~/.cache/opencode/packages/@cortexkit/opencode-magic-context@latest",
  "cached": "0.18.0",
  "latest": "0.19.0"
}

Storage

{
  "path": "~/.local/share/cortexkit/magic-context",
  "exists": true,
  "context_db_size": "16.3 MB"
}

Recent sessions

No recent OpenCode sessions found (or OpenCode DB unavailable on this runtime).

Historian dumps

(Metadata only — XML content is not included in this report.)
Dumps are stored per-project under <project>/.opencode/magic-context/historian/.

{
  "byProject": [],
  "legacyDumps": {
    "dir": "/tmp/opencode/magic-context/historian",
    "count": 0,
    "recent": []
  }
}

Historian failures (session_meta)

No sessions with historian failures.

Log file

  • Path: /tmp/opencode/magic-context/magic-context.log
  • Exists: false
  • Size: 0 KB

Historian failure signals (log, sanitized)

No historian failure log lines found in recent history.

Log (last 400 lines, sanitized)

<no log output>

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