Skip to content

Desktop app does not inherit full PATH from shell environment #15195

Closed

Description

@Jei-sKappa

Description

Commands that rely on tools installed in the user's PATH work correctly in OpenCode TUI but fail in OpenCode Desktop with "command not found" errors. The Desktop app appears to not inherit the same shell environment/PATH as the TUI. This was working in v1.2.14 and broke in v1.2.15.

Plugins

No response

OpenCode version

1.2.15 (regression from 1.2.14)

Steps to reproduce

  1. Have a CLI tool installed and available in your normal shell PATH (e.g. uv, but any non-system binary applies).
  2. Confirm it works in a regular terminal session.
  3. Open OpenCode TUI (v1.2.15) in the same repo — commands using that tool succeed.
  4. Open OpenCode Desktop (v1.2.15) in the same repo — the same commands fail with "command not found" (exit code 127).
  5. Downgrade to v1.2.14 — Desktop works correctly again.

Screenshot and/or share link

No response

Operating System

macOS Tahoe 26.3

Terminal

Ghostty

Activity

  1. github-actions commented on Feb 26, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If this is indeed a regression specific to the Desktop app introduced in v1.2.15, it may warrant staying open as a separate tracking issue.

  2. Jei-sKappa commented on Feb 26, 2026

    @Jei-sKappa
    Author

    More context

    Conversation

    Note that I hid some sensitive parts but they are not relevant

    # UV command check in env with -h flags for al/si

    Session ID: ses_366b23adeffeQCzLIA3CUvr5Kt
    Created: 2/26/2026, 10:35:36 AM
    Updated: 2/26/2026, 10:45:54 AM


    User

    Can you please run some uv commands using just and uv to check if the env works? Use -h for 'al' and 'si'.
    If they are not working stop and tell me


    Assistant (Build · gpt-5.1-codex-mini · 10.4s)

    Thinking:

    Preparing to run 'just' and 'uv' commands

    Tool: bash

    Input:

    {
      "command": "just al -h",
      "description": "Show help for parser 'al' target"
    }

    Output:

    cd parser && uv run src/allegati.py -h
    usage: allegati.py [-h] [--max-urls MAX_URLS]
    <!-- NOTE: OTHER OPTIONS HIDDEN  -->
    
    Elabora <!-- NOTE: PART OF DESCRIPTION HIDDEN --> URL
    
    options:
      -h, --help            show this help message and exit
      --max-urls MAX_URLS   Numero massimo di URL candidate da processare
      <!-- NOTE: OTHER OPTIONS HIDDEN  -->
    
    

    Assistant (Build · gpt-5.1-codex-mini · 8.7s)

    Thinking:

    Checking just si help command

    Tool: bash

    Input:

    {
      "command": "just si -h",
      "description": "Show help for parser 'si' target"
    }

    Output:

    cd parser && uv run src/sintesi.py -h
    usage: sintesi.py [-h] [--max-urls MAX_URLS]
    <!-- NOTE: OTHER OPTIONS HIDDEN  -->
    
    Elabora <!-- NOTE: PART OF DESCRIPTION HIDDEN --> da allegati.json
    
    options:
      -h, --help            show this help message and exit
      --max-urls MAX_URLS   Numero massimo di elementi da processare
      <!-- NOTE: OTHER OPTIONS HIDDEN  -->
    
    

    Assistant (Build · gpt-5.1-codex-mini · 5.1s)

    Thinking:

    Summarizing help command results

    I'll confirm both just al -h and just si -h ran successfully and their outputs indicate the environment is working well, then provide a concise final message with a bullet list summarizing these points and mention that the user can use -h for help with these commands.

    • just al -h (runs uv run src/allegati.py -h) prints the parser help, so the “al” target runs and the environment is usable.
    • just si -h (runs uv run src/sintesi.py -h) prints the synthesis help, confirming the “si” target also works.

    Everything ran successfully; no further action needed unless you want to execute a specific workflow.


    User

    Ok, can you please try it again now?


    Assistant (Build · gpt-5.1-codex-mini · 4.5s)

    Thinking:

    Verifying help commands

    Tool: bash

    Input:

    {
      "command": "just al -h",
      "description": "Show help for parser 'al' target"
    }

    Output:

    cd parser && uv run src/allegati.py -h
    bash: uv: command not found
    error: Recipe `al` failed on line 21 with exit code 127
    
    

    Assistant (Build · gpt-5.1-codex-mini · 9.7s)

    Thinking:

    Diagnosing missing 'uv' command error

    Tool: bash

    Input:

    {
      "command": "just si -h",
      "description": "Show help for parser 'si' target"
    }

    Output:

    cd parser && uv run src/sintesi.py -h
    bash: uv: command not found
    error: Recipe `si` failed on line 25 with exit code 127
    
    

    Assistant (Build · gpt-5.1-codex-mini · 5.2s)

    Thinking:

    Summarizing command failures due to missing binary

    I’m wrapping up by explaining that re-running the commands just al -h and just si -h failed because the uv command is missing from the environment. I’ll mention what we tried, the failure message, and that no further action was taken since the user requested a retry. I’ll suggest checking if uv is installed and accessible, possibly installing it via pip, and verifying the PATH setup to resolve this.

    • Re-ran just al -h and just si -h as requested; both now fail immediately because uv is missing (bash: uv: command not found), so neither help text can run.
    • Looks like uv is no longer on PATH in this shell, so the just targets can’t start; please reinstall/activate uv (or adjust your environment) before retrying, and I can re-run them once it’s available.

    Justfile content

    set shell := ["bash", "-c"]
    
    # Directory di lavoro
    
    parser := "parser"
    
    # Comandi di default
    default:
        @just --list
    
    # Esegue allegati_bandi.py
    al *FLAGS:
        cd {{ parser }} && uv run src/allegati.py {{ FLAGS }}
    
    # Esegue sintesi_bandi.py
    si *FLAGS:
        cd {{ parser }} && uv run src/sintesi.py {{ FLAGS }}
    

    Note that the first message was sent using the TUI and the second using Desktop v1.2.15. After that I downgraded to v1.2.14 and in the same chat I ask the agent to rerun them and they worked just fine.

    Hope those info are useful.

  3. kbegiedza commented on Feb 26, 2026

    @kbegiedza

    fast workaround:

    source ~/.zshrc and resume

  4. Jei-sKappa commented on Feb 26, 2026

    @Jei-sKappa
    Author

    Thanks for the fast reply!
    I tried running source ~/.zshrc in my terminal, through OpenCode's shell, and even asked the agent itself to run source ~/.zshrc as a command — but the issue persists in all cases. Could you clarify what you mean by "and resume"? Is there a specific workflow I'm missing?

  5. nexxeln commented on Feb 26, 2026

    @nexxeln
    Contributor

    working on a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwebRelates to opencode on web / desktop

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions