feat: warm-pool ACP sessions and stage TTFT timings
Pre-bootstrap two cursor-agent processes so createSession skips spawn/initialize on the hot path, open SSE before session setup, and log per-stage durations for first-token diagnosis.
This commit is contained in:
@@ -1,6 +1,30 @@
|
||||
import { describe, it } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { extractToolNameFromPermission } from "./session-manager.mjs";
|
||||
import {
|
||||
extractToolNameFromPermission,
|
||||
fmtMs,
|
||||
nowMs,
|
||||
WARM_POOL_SIZE,
|
||||
} from "./session-manager.mjs";
|
||||
|
||||
describe("fmtMs / nowMs", () => {
|
||||
it("formats durations to one decimal millisecond", () => {
|
||||
assert.equal(fmtMs(12.34), "12.3ms");
|
||||
assert.equal(fmtMs(0), "0ms");
|
||||
});
|
||||
|
||||
it("nowMs is monotonic numeric", () => {
|
||||
const a = nowMs();
|
||||
const b = nowMs();
|
||||
assert.equal(typeof a, "number");
|
||||
assert.ok(b >= a);
|
||||
});
|
||||
|
||||
it("exposes WARM_POOL_SIZE as a non-negative integer", () => {
|
||||
assert.equal(typeof WARM_POOL_SIZE, "number");
|
||||
assert.ok(WARM_POOL_SIZE >= 0);
|
||||
});
|
||||
});
|
||||
|
||||
describe("extractToolNameFromPermission", () => {
|
||||
it("parses client MCP title format", () => {
|
||||
|
||||
Reference in New Issue
Block a user