fix: connect Page Data sandbox to user PostgreSQL
Memind CI / Test, build, and release guards (pull_request) Failing after 15m29s

This commit is contained in:
john
2026-07-17 10:44:41 +08:00
parent 4d57c35b66
commit 93811f4657
8 changed files with 179 additions and 5 deletions
+14 -1
View File
@@ -1870,7 +1870,7 @@ export function createUserAuth(pool, options = {}) {
);
// Wire up the sandbox MCP for user workspace tools and the private data space.
// File operations are OS-bound to the user's workspace; private_data_* tools
// only touch the user's single SQLite data space inside that workspace.
// only touch the user's isolated PostgreSQL schema.
let sandboxMcp = null;
if (effectiveCapabilities.static_publish || effectiveCapabilities.private_data_space) {
try {
@@ -1879,6 +1879,13 @@ export function createUserAuth(pool, options = {}) {
env,
user,
});
const containerFlag = String(env.GOOSED_MCP_CONTAINERIZED ?? '').trim();
const containerized = containerFlag
? containerFlag === '1'
: Boolean(
env.GOOSED_MCP_NODE_PATH &&
path.resolve(env.GOOSED_MCP_NODE_PATH) !== path.resolve(process.execPath),
);
sandboxMcp = {
// When goosed runs in a container its filesystem is split from the portal's,
// so the host paths the portal would otherwise send (node binary, MCP script)
@@ -1891,6 +1898,12 @@ export function createUserAuth(pool, options = {}) {
workspaceRef: workspaceCapability.workspaceRef,
userId: user.id,
nodeExecPath: env.GOOSED_MCP_NODE_PATH,
containerized,
userDataBackend: env.MINDSPACE_USERDATA_BACKEND,
userDataPgUrl: env.MINDSPACE_USERDATA_PG_URL,
userDataMcpPgUrl: env.MINDSPACE_USERDATA_MCP_PG_URL,
userDataPgHostGateway: env.MINDSPACE_USERDATA_MCP_PG_HOST,
userDataAutoProvision: env.MINDSPACE_USERDATA_AUTO_PROVISION,
};
} catch (err) {
console.warn('[getAgentSessionPolicy] sandbox MCP setup failed, falling back:', err?.message);