mcp --http: SSE keepalive for long tool calls; public App Store search shares one 20-a-minute budget

This commit is contained in:
CRTkafa 2026-10-29 19:05:53 +07:00
parent c500866295
commit 9620768897
6 changed files with 65 additions and 4 deletions

View file

@ -268,3 +268,12 @@ describe('http, public mode', () => {
expect(() => startHttp({ ...base })).toThrow('only for --public');
});
});
test('App Store search keeps one shared budget of 20 calls a minute', async () => {
const { searchBudget } = await import('../cli/mcp-public');
const t0 = Date.now() + 3_600_000; // after any real call earlier in this file
let last: ReturnType<typeof searchBudget> = { ok: true };
for (let i = 0; i < 25; i++) last = searchBudget(t0 + i);
expect(last.ok).toBe(false);
expect(searchBudget(t0 + 61_000).ok).toBe(true);
});