fix(skill-mcp): pass workspace directory as cwd to stdio MCP processes
In OpenCode web multi-workspace mode, skill_mcp spawned stdio child processes inherited process.cwd() instead of the session's workspace directory. Pass toolContext.directory through SkillMcpClientInfo to StdioClientTransport's cwd parameter.
This commit is contained in:
@@ -60,6 +60,7 @@ export async function createStdioClient(params: SkillMcpClientConnectionParams):
|
||||
args,
|
||||
env: mergedEnv,
|
||||
stderr: "ignore",
|
||||
...(info.directory ? { cwd: info.directory } : {}),
|
||||
})
|
||||
|
||||
const client: McpClient = stdioClientDependencies.createClient(
|
||||
|
||||
@@ -24,6 +24,7 @@ export interface SkillMcpClientInfo {
|
||||
skillName: string
|
||||
sessionID: string
|
||||
scope?: SkillScope | "local"
|
||||
directory?: string
|
||||
}
|
||||
|
||||
export interface SkillMcpServerContext {
|
||||
|
||||
Reference in New Issue
Block a user