fix(agent-run): tolerate goosed stdio MCP listing gaps during session reconcile.
Memind CI / Test, build, and release guards (push) Failing after 4s

Skip hot-adding stdio extensions goosed omits from /extensions, stabilize MCP
scope during session start, and wire chat intent routing into the agent-run worker.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-01 20:02:33 +08:00
parent 9d78927d1b
commit cdc265d7e0
6 changed files with 202 additions and 68 deletions
+48
View File
@@ -122,6 +122,24 @@ test('extensionsNeedingRefresh adds missing extensions', () => {
assert.equal(toAdd[0].name, 'summon');
});
test('extensionsNeedingRefresh does not hot-add missing stdio extensions', () => {
const { toRemove, toAdd } = extensionsNeedingRefresh(
[{ name: 'developer', available_tools: ['read_image'] }],
[
{ name: 'developer', available_tools: ['read_image'] },
{
type: 'stdio',
name: 'sandbox-fs',
cmd: '/usr/local/bin/node',
args: ['/opt/portal/mindspace-sandbox-mcp.mjs', '/tmp/user-1'],
available_tools: ['read_file'],
},
],
);
assert.deepEqual(toRemove, []);
assert.deepEqual(toAdd, []);
});
test('extensionPolicyViolations reports unexpected, duplicate, and mismatched extensions', () => {
assert.deepEqual(
extensionPolicyViolations(
@@ -143,6 +161,36 @@ test('extensionPolicyViolations reports unexpected, duplicate, and mismatched ex
);
});
test('extensionPolicyViolations ignores stdio extensions omitted from goosed listing', () => {
assert.deepEqual(
extensionPolicyViolations(
[{ name: 'developer', available_tools: ['read_image'] }],
[
{ name: 'developer', available_tools: ['read_image'] },
{
type: 'stdio',
name: 'sandbox-fs',
cmd: '/usr/local/bin/node',
args: ['/opt/portal/mindspace-sandbox-mcp.mjs', '/tmp/user-1'],
available_tools: ['read_file'],
},
{
type: 'stdio',
name: 'tkmind-search',
cmd: '/usr/local/bin/node',
args: ['/opt/portal/tkmind-search-mcp.mjs'],
available_tools: ['search_external'],
},
],
),
{
unexpected: [],
duplicate: [],
missingOrMismatched: [],
},
);
});
test('reconcileAgentSession tolerates invalid working directory during resume sync without restart', async () => {
const calls = [];
const apiFetch = async (pathname) => {