fix(agent-run): resolve MCP paths correctly from bundled worker
Memind CI / Test, build, and release guards (push) Successful in 4m10s

Agent-run-worker bundles under scripts/, so fallback MCP resolution pointed
at scripts/tkmind-excel-mcp.mjs and broke Goose session startup on H5 image
tasks. Pin MEMIND_PORTAL_H5_ROOT to the repo root and honor TKMIND_EXCEL_MCP_SERVER_PATH.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-31 19:32:39 +08:00
parent 334b78a7df
commit 61eebb44ec
3 changed files with 56 additions and 1 deletions
+10 -1
View File
@@ -183,6 +183,15 @@ export function resolveExcelMcpServerPath(overridePath, runtimeRoot) {
);
}
/** Prefer explicit env overrides; TKMIND_* matches search MCP naming on 103/.env. */
export function resolveExcelMcpOverridePath(env = process.env) {
return String(
env.GOOSED_EXCEL_MCP_SERVER_PATH
?? env.TKMIND_EXCEL_MCP_SERVER_PATH
?? '',
).trim();
}
function isGoosedMcpContainerized(sandboxMcp = null) {
const containerFlag = String(process.env.GOOSED_MCP_CONTAINERIZED ?? '').trim();
if (containerFlag) return containerFlag === '1';
@@ -852,7 +861,7 @@ export function buildAgentExtensionPolicy(
cmd: resolveSandboxMcpNodeExecPath(sandboxMcp?.nodeExecPath),
args: [
resolveExcelMcpServerPath(
process.env.GOOSED_EXCEL_MCP_SERVER_PATH,
resolveExcelMcpOverridePath(),
bundledMcpRuntimeRoot,
),
excelWorkspaceRoot,