fix(release-gate): isolate PAGE agent runs from split-service MCP routing.
Memind CI / Test, build, and release guards (pull_request) Failing after 17s

Gate stacks inherited developer MCP env and routed sandbox-fs writes to the
8082 workspace root, so PAGE/DATA scenarios failed with ENOENT despite a
healthy goosed. Sanitize isolated portal env, grant gate skills, and align
CHAT search assertions with the tkmind_search tool name.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-30 09:55:08 +08:00
parent b553107817
commit d67ebb0c77
5 changed files with 392 additions and 14 deletions
+20 -9
View File
@@ -4,6 +4,7 @@ import path from 'node:path';
import {
createLocalGateStack,
grantGateUserSkillsByUsername,
selectBackendLlmProvider,
seedSelectedProviderKeys,
} from '../release-gate/local-stack.mjs';
@@ -16,8 +17,12 @@ const scenarioIds = [
async function runScenario(scenarioId, port) {
const childTimeoutMs = Math.max(
30_000,
Number(process.env.RELEASE_GATE_SCENARIO_PROCESS_TIMEOUT_MS ?? 360_000) || 360_000,
60_000,
Number(process.env.RELEASE_GATE_SCENARIO_PROCESS_TIMEOUT_MS ?? 900_000) || 900_000,
);
const stepTimeoutMs = Math.max(
60_000,
Number(process.env.RELEASE_GATE_SCENARIO_TIMEOUT_MS ?? 900_000) || 900_000,
);
const code = await new Promise((resolve, reject) => {
const child = spawn(
@@ -28,9 +33,7 @@ async function runScenario(scenarioId, port) {
env: {
...process.env,
JOHN_PASSWORD: '888888',
RELEASE_GATE_SCENARIO_TIMEOUT_MS: String(
Number(process.env.RELEASE_GATE_SCENARIO_TIMEOUT_MS ?? 300_000) || 300_000,
),
RELEASE_GATE_SCENARIO_TIMEOUT_MS: String(stepTimeoutMs),
},
stdio: 'inherit',
},
@@ -77,10 +80,18 @@ async function register(username) {
try {
await register('john2');
const results = await Promise.all(scenarioIds.map(async (scenarioId) => ({
scenarioId,
code: await runScenario(scenarioId, new URL(stack.baseUrl).port),
})));
await grantGateUserSkillsByUsername({
targetUrl: stack.mysqlUrl,
username: 'john2',
skillNames: ['static-page-publish'],
});
const results = [];
for (const scenarioId of scenarioIds) {
results.push({
scenarioId,
code: await runScenario(scenarioId, new URL(stack.baseUrl).port),
});
}
for (const result of results) {
console.log(`${result.code === 0 ? 'PASS' : 'FAIL'} ${result.scenarioId}`);
}