fix(agent): inject Asia/Shanghai time anchor on 0630007 line
Agent replies were reporting UTC time because 0630007-memind never injected TKMind 当前时间基准 into session memory. Port the time anchor from the 0630004 work only—no miniapp branch changes—and add a 103 rollback script. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,6 +6,16 @@ import {
|
||||
reconcileAgentSession,
|
||||
} from './session-reconcile.mjs';
|
||||
|
||||
function harnessMemoryResponse(pathname) {
|
||||
if (pathname === '/agent/harness_remember' || pathname === '/agent/harness_bootstrap') {
|
||||
return {
|
||||
ok: true,
|
||||
text: async () => JSON.stringify({ remembered: true, ok: true }),
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
test('extensionConfigsMatch compares available_tools', () => {
|
||||
const sessionExt = { name: 'developer', available_tools: ['write', 'edit'] };
|
||||
const desired = { name: 'developer', available_tools: ['write', 'edit', 'shell', 'tree'] };
|
||||
@@ -77,6 +87,8 @@ test('reconcileAgentSession tolerates invalid working directory during resume sy
|
||||
text: async () => JSON.stringify({ ok: true }),
|
||||
};
|
||||
}
|
||||
const harness = harnessMemoryResponse(pathname);
|
||||
if (harness) return harness;
|
||||
throw new Error(`unexpected path: ${pathname}`);
|
||||
};
|
||||
|
||||
@@ -90,6 +102,8 @@ test('reconcileAgentSession tolerates invalid working directory during resume sy
|
||||
'/sessions/session-1',
|
||||
'/agent/update_working_dir',
|
||||
'/sessions/session-1/extensions',
|
||||
'/agent/harness_remember',
|
||||
'/agent/harness_bootstrap',
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -118,6 +132,8 @@ test('reconcileAgentSession skips restart when extensions already match', async
|
||||
text: async () => JSON.stringify({ ok: true }),
|
||||
};
|
||||
}
|
||||
const harness = harnessMemoryResponse(pathname);
|
||||
if (harness) return harness;
|
||||
throw new Error(`unexpected path: ${pathname}`);
|
||||
};
|
||||
|
||||
@@ -126,7 +142,12 @@ test('reconcileAgentSession skips restart when extensions already match', async
|
||||
sessionPolicy: { extensionOverrides: [{ name: 'skills', available_tools: [] }] },
|
||||
});
|
||||
|
||||
assert.deepEqual(calls, ['/sessions/session-1', '/sessions/session-1/extensions']);
|
||||
assert.deepEqual(calls, [
|
||||
'/sessions/session-1',
|
||||
'/sessions/session-1/extensions',
|
||||
'/agent/harness_remember',
|
||||
'/agent/harness_bootstrap',
|
||||
]);
|
||||
});
|
||||
|
||||
test('reconcileAgentSession restarts after adding missing extensions', async () => {
|
||||
@@ -151,6 +172,8 @@ test('reconcileAgentSession restarts after adding missing extensions', async ()
|
||||
text: async () => JSON.stringify({ ok: true }),
|
||||
};
|
||||
}
|
||||
const harness = harnessMemoryResponse(pathname);
|
||||
if (harness) return harness;
|
||||
throw new Error(`unexpected path: ${pathname}`);
|
||||
};
|
||||
|
||||
@@ -164,5 +187,7 @@ test('reconcileAgentSession restarts after adding missing extensions', async ()
|
||||
'/sessions/session-1/extensions',
|
||||
'/agent/add_extension',
|
||||
'/agent/restart',
|
||||
'/agent/harness_remember',
|
||||
'/agent/harness_bootstrap',
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user