test: update heartbeat and agent list thresholds

This commit is contained in:
Peter Steinberger
2026-01-12 17:13:49 +00:00
parent fd1e959c2d
commit f1dd59bf82
4 changed files with 4 additions and 2 deletions

View File

@@ -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 () => {

View File

@@ -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({

View File

@@ -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: {

View File

@@ -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");