Skip to content

Canonicalize the artifact root (realpath) so isolated projects avoid symlinked temp paths #72

Description

@kitlangton

Drive 2.0.0 (464f9a3), OpenCode V2 0b771030ed and e73fa5f476.

Default artifacts live under os.tmpdir(), which on macOS is /var/folders/... → symlink to /private/var/folders/.... OpenCode currently discovers the isolated project's .opencode directory under both spellings, starts two watchers, loads every local plugin twice, and fails activation with Duplicate plugin ID. That is an OpenCode bug (tracked separately), but Drive is the thing putting every isolated project under a symlinked root, so every plugin probe on macOS hits it.

Proposal: resolve the artifact root with realpath in instance.ts (resolve(join(tmpdir(), "opencode-drive"))) and pass the canonical path everywhere (--dev, project files, OPENCODE_CONFIG_DIR). Until then the workaround is TMPDIR="$PWD/.drive-output/tmp", now documented in the tui-regressions README under "Plugin registry".

Repro: test/manual/tui-regressions/plugin-registry.ts without TMPDIR; server log shows two watcher started path=…/.opencode lines in one boot span followed by failed to reload plugins cause=Die(Error: Duplicate plugin ID: alpha).

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions