Skip to content

CWD not set when launching OpenCode — sessions not found #47

Description

@romor001

When the plugin launches OpenCode, the current working directory (CWD) is not set to the vault root. As a result, OpenCode cannot locate its session data, since it doesn't know which directory the sessions are stored in.

Expected behavior:
OpenCode should be started with CWD set to the vault root directory, so it can find and resume existing sessions.

Actual behavior:
OpenCode starts without a proper CWD, resulting in no access to previous sessions. Each launch appears to start fresh.

Environment:
• Plugin version: latest (via BRAT)
• Obsidian desktop on macOS
• OpenCode CLI installed globally

Suggested fix:
Ensure the child process spawning OpenCode explicitly sets cwd to the vault root path (available via this.app.vault.getRoot().vault.adapter.basePath or similar).

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions