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 — Windows: OpenCode 2.3.0 ignores customized `TEMP`/`TMP` and uses `C:\Users\<user>\AppData\Local\Temp\opencode` instead of `%TEMP%\opencode` · Issue #64019 · anomalyco/opencode

Windows: OpenCode 2.3.0 ignores customized TEMP/TMP and uses C:\Users\<user>\AppData\Local\Temp\opencode instead of %TEMP%\opencode #64019

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Windows: OpenCode 2.3.0 ignores customized TEMP/TMP and uses C:\Users\<user>\AppData\Local\Temp\opencode instead of %TEMP%\opencode#64019
Copy link
Labels
area/coreAgent loop, tools and configplatform/windowsWindowstriagingtype/bugSomething is brokenversion/v2OpenCode 2.x

Description

@NGC13009
NGC13009
opened on Nov 15, 2026
Issue body actions

Description

Description

On Windows, OpenCode 2.3.0 appears to ignore a customized TEMP/TMP environment variable when choosing its temporary directory.

In previous versions, OpenCode used %TEMP%\opencode (i.e. it respected the current TEMP value). In 2.3.0, it seems to always use the default user temp path:

C:\Users\<username>\AppData\Local\Temp\opencode

even when TEMP and TMP have been changed to another location (for example D:\Temp).

This means the temporary files are written to the system default user temp directory instead of the directory configured through the environment variables.

Environment

  • OpenCode version: 2.3.0
  • OS: Windows 10/11 (please fill in exact version)
  • Installation method: (e.g. desktop app / CLI / npm / standalone — please fill in)
  • Shell used to launch OpenCode: (e.g. PowerShell / CMD / Windows Terminal — please fill in)

Expected behavior

OpenCode should use %TEMP%\opencode / %TMP%\opencode, i.e. it should respect the current TEMP/TMP environment variables, as previous versions did.

Alternatively, if there is a reason not to inherit them, there should be a documented configuration option or environment variable to override the temp directory.

Actual behavior

OpenCode creates/uses:

C:\Users\<username>\AppData\Local\Temp\opencode

even when TEMP and TMP point to a different directory.

Additional context

  • This looks related to the existing reports about OpenCode not respecting TMPDIR/TEMP/TMP on Windows and about the bundled Bun runtime’s temp-directory handling.
  • I have not yet confirmed whether setting BUN_TMPDIR changes the behavior, but the regression compared with previous versions seems to be in how OpenCode resolves its temp root on Windows.
  • Please let me know if you need logs, a trace, or a minimal reproduction repository.

Plugins

It most likely has nothing to do with any plugin, because this just looks like an issue with system prompt injection.

OpenCode version

2.3.0

Steps to reproduce

  1. On Windows, change the user/system TEMP and TMP environment variables to a custom directory, e.g. D:\Temp.
  2. Open a new terminal and verify the variables are inherited:
    echo $env:TEMP
    echo $env:TMP
    Both should print the custom path.
  3. Start OpenCode 2.3.0 from that terminal.
  4. Trigger any operation that creates OpenCode temporary files.
  5. Check where the opencode temp directory is created.

Screenshot

No response

Operating System

windows 11

Terminal

PowerShell

Activity

  1. opencodejr commented on Nov 15, 2026

    @opencodejr
    opencodejrBot
    on Nov 15, 2026
    Contributor
    More actions

    Thanks for the report. Before we try to reproduce it, a few details would help.

    OpenCode builds its temp folder from the system temp directory plus opencode (path.join(os.tmpdir(), app) in packages/util/src/global-roots.ts). As far as I can see, that code is the same in 2.2.7 and 2.3.0. The path you see (for example in the agent's environment instructions) comes from the shared background service, which OpenCode normally finds or starts automatically (troubleshooting docs). My guess, which I haven't confirmed: if that service started before you changed TEMP/TMP, or something other than your terminal started it, it could still be using the default AppData\Local\Temp.

    Could you tell us:

    1. How you installed and launch OpenCode: the Desktop app, or the CLI (npm @opencode/cli, install script, other)? The template placeholders for this were left unfilled.
    2. What opencode --version prints, and which earlier version you saw using D:\Temp\opencode.
    3. Whether a service restart changes it. In a PowerShell where echo $env:TEMP prints your custom path, run opencode service restart, start OpenCode again from that shell, and check which folder it uses.
    4. Where you saw the path: the agent's environment instructions, a file actually created on disk, or both? If it's a file, which operation created it?

    You can reply here with the details or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know when you're done.

    Related issues I found, ordered by likelihood. None of them looks like the same problem:

    • shell: add project-scoped temp directory (shared %TEMP%\opencode mixes projects) #62740: the shared %TEMP%\opencode scratch directory on Windows (asks for project scoping and a setting to change it)
    • desktop: server crashes with EISDIR when TMP points to an ImDisk RAM disk (Bun realpath) #63804: the Desktop server crashes when TMP points at an ImDisk RAM disk
    • Error: EISDIR: illegal operation on a directory, lstat 'T:\opencode' #49887: OpenCode using a custom temp drive (T:\opencode) on Windows
  2. opencodejr
    added
    area/coreAgent loop, tools and config
    platform/windowsWindows
    triaging
    type/bugSomething is broken
    version/v2OpenCode 2.x
    on Nov 15, 2026
  3. opencodejr
    closed this as not plannedon Nov 15, 2026
  4. opencodejr commented on Nov 15, 2026

    @opencodejr
    opencodejrBot
    on Nov 15, 2026
    Contributor
    More actions

    We haven't heard back here, so I'm closing this issue for now.

    We were waiting for a few details:

    • how OpenCode is installed and launched (Desktop or CLI)
    • the exact opencode --version and the last version that used D:\Temp\opencode
    • whether running opencode service restart from a shell where $env:TEMP shows your custom path changes the folder
    • where you saw the path

    Without these, we can't tell a 2.3.0 regression apart from a background service that started with older environment variables.

    If you can still reproduce this, reply here with those details and the issue will reopen.

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

    area/coreAgent loop, tools and configplatform/windowsWindowstriagingtype/bugSomething is brokenversion/v2OpenCode 2.x

    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.