Skip to content

run: program importing Drive via relative source path fails with missing default-config.jsonc #77

Description

@kitlangton

Drive c2bfef2 (packages/drive), Bun 1.4.0, OpenCode V2 36095decd7.

A one-shot program passed to drive run that imports Drive from source (import { Llm, OpenCodeDriver } from "../src/index.js", as a scratch script under packages/drive/.drive-output/ would) type-checks fine and then fails at instance initialization:

error: ENOENT: no such file or directory, open '/private/var/folders/.../opencode-drive-run-92qgPu/script-runtime/compiled/default-config.jsonc'
      _tag: "OpenCodeDriverError",
 operation: "project.initialize",

src/instance/instance.ts reads new URL("./default-config.jsonc", import.meta.url), which resolves relative to the compiled bundle in the run's script-runtime/compiled/ directory; the bundle step does not copy the asset. Switching the import to the package name (from "opencode-drive") works, so the workaround is trivial, but the failure surfaces as a project-initialize ENOENT rather than pointing at the import.

Expected: either the compile step carries default-config.jsonc (or inlines it), or run/check rejects a relative Drive source import with a message that names the fix.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions