fix(opencode): pass full MCP launch args

This commit is contained in:
777genius 2026-04-30 14:02:23 +03:00
parent 0b28d8f4b2
commit f391dda3cb
5 changed files with 17 additions and 11 deletions

View file

@ -268,6 +268,7 @@ async function createOpenCodeRuntimeAdapterRegistry(): Promise<TeamRuntimeAdapte
if (mcpEntry) {
bridgeEnv.CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_COMMAND = mcpLaunchSpec.command;
bridgeEnv.CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_ENTRY = mcpEntry;
bridgeEnv.CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_ARGS_JSON = JSON.stringify(mcpLaunchSpec.args);
}
} catch (error) {
logger.warn(

View file

@ -79,6 +79,7 @@ liveDescribe('OpenCode mixed recovery live e2e', () => {
XDG_DATA_HOME: path.join(tempDir, 'xdg-data-single'),
CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_COMMAND: mcpLaunchSpec.command,
CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_ENTRY: mcpLaunchSpec.args[0] ?? '',
CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_ARGS_JSON: JSON.stringify(mcpLaunchSpec.args),
};
const bridgeClient = new OpenCodeBridgeCommandClient({
binaryPath: orchestratorCli,
@ -182,6 +183,7 @@ liveDescribe('OpenCode mixed recovery live e2e', () => {
XDG_DATA_HOME: path.join(tempDir, 'xdg-data-multi'),
CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_COMMAND: mcpLaunchSpec.command,
CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_ENTRY: mcpLaunchSpec.args[0] ?? '',
CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_ARGS_JSON: JSON.stringify(mcpLaunchSpec.args),
};
const bridgeClient = new OpenCodeBridgeCommandClient({
binaryPath: orchestratorCli,

View file

@ -69,6 +69,7 @@ liveDescribe('OpenCode team provisioning live e2e', () => {
XDG_DATA_HOME: path.join(tempDir, 'xdg-data'),
CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_COMMAND: mcpLaunchSpec.command,
CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_ENTRY: mcpLaunchSpec.args[0] ?? '',
CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_ARGS_JSON: JSON.stringify(mcpLaunchSpec.args),
};
const bridgeClient = new OpenCodeBridgeCommandClient({
binaryPath: orchestratorCli,

View file

@ -128,22 +128,23 @@ function getRealAgentTeamsMcpLaunchSpec(): { command: string; args: string[] } {
}
}
const distEntry = path.join(workspaceRoot, 'mcp-server', 'dist', 'index.js');
if (fs.existsSync(distEntry)) {
const tsxCommand = path.join(
workspaceRoot,
'node_modules',
'.bin',
process.platform === 'win32' ? 'tsx.cmd' : 'tsx'
);
if (fs.existsSync(sourceEntry) && fs.existsSync(tsxCommand)) {
return {
command: process.execPath,
args: [distEntry],
command: tsxCommand,
args: [sourceEntry],
};
}
const distEntry = path.join(workspaceRoot, 'mcp-server', 'dist', 'index.js');
return {
command: path.join(
workspaceRoot,
'node_modules',
'.bin',
process.platform === 'win32' ? 'tsx.cmd' : 'tsx'
),
args: [path.join(workspaceRoot, 'mcp-server', 'src', 'index.ts')],
command: process.execPath,
args: [distEntry],
};
}

View file

@ -73,6 +73,7 @@ export async function createOpenCodeLiveHarness(input: {
CLAUDE_TEAM_CONTROL_URL: controlApi.baseUrl,
CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_COMMAND: mcpLaunchSpec.command,
CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_ENTRY: mcpLaunchSpec.args[0] ?? '',
CLAUDE_MULTIMODEL_AGENT_TEAMS_MCP_ARGS_JSON: JSON.stringify(mcpLaunchSpec.args),
};
if (process.env.OPENCODE_E2E_USE_REAL_APP_CREDENTIALS !== '1') {
bridgeEnv.XDG_DATA_HOME = path.join(input.tempDir, 'xdg-data');