Skip to content

Commit c00f3dc

Browse files
fix: add directory to plugin client for multi-project support
When OpenCode Server serves multiple projects, plugin's internal client needs to specify the target directory. Without this, API calls from plugins (e.g., delegate_task calling session.get) would fallback to process.cwd(), causing NotFoundError when accessing sessions from different projects. This fix ensures each Instance's plugin client includes the correct directory parameter, enabling proper cross-project session access in multi-project environments like oh-my-opencodeui.
1 parent 0b91e90 commit c00f3dc

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

packages/opencode/src/plugin/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export namespace Plugin {
2323
const state = Instance.state(async () => {
2424
const client = createOpencodeClient({
2525
baseUrl: "http://localhost:4096",
26+
directory: Instance.directory,
2627
// @ts-ignore - fetch type incompatibility
2728
fetch: async (...args) => Server.App().fetch(...args),
2829
})

0 commit comments

Comments
 (0)