test: update heartbeat and agent list thresholds
This commit is contained in:
@@ -22,6 +22,7 @@ vi.mock("./model-auth.js", () => ({
|
||||
getApiKeyForModel: vi.fn(),
|
||||
ensureAuthProfileStore: vi.fn(() => ({ profiles: {} })),
|
||||
resolveAuthProfileOrder: vi.fn(() => []),
|
||||
resolveEnvApiKey: vi.fn(() => null),
|
||||
}));
|
||||
|
||||
vi.mock("../providers/github-copilot-token.js", async () => {
|
||||
|
||||
@@ -52,7 +52,7 @@ describe("stripHeartbeatToken", () => {
|
||||
});
|
||||
|
||||
it("keeps heartbeat replies when remaining content exceeds threshold", () => {
|
||||
const long = "A".repeat(31);
|
||||
const long = "A".repeat(350);
|
||||
expect(
|
||||
stripHeartbeatToken(`${long} ${HEARTBEAT_TOKEN}`, { mode: "heartbeat" }),
|
||||
).toEqual({
|
||||
|
||||
@@ -803,7 +803,7 @@ describe("runCronIsolatedAgentTurn", () => {
|
||||
sendMessageIMessage: vi.fn(),
|
||||
};
|
||||
// Long content after HEARTBEAT_OK should still be delivered.
|
||||
const longContent = `Important alert: ${"a".repeat(50)}`;
|
||||
const longContent = `Important alert: ${"a".repeat(350)}`;
|
||||
vi.mocked(runEmbeddedPiAgent).mockResolvedValue({
|
||||
payloads: [{ text: `HEARTBEAT_OK ${longContent}` }],
|
||||
meta: {
|
||||
|
||||
@@ -39,6 +39,7 @@ describe("gateway server agents", () => {
|
||||
expect(res.payload?.agents.map((agent) => agent.id)).toEqual([
|
||||
"work",
|
||||
"home",
|
||||
"main",
|
||||
]);
|
||||
const work = res.payload?.agents.find((agent) => agent.id === "work");
|
||||
const home = res.payload?.agents.find((agent) => agent.id === "home");
|
||||
|
||||
Reference in New Issue
Block a user