Menu
popagent
publicLatest change 6edc7e928c57dab23c0973ed3f7ee70b3ebb72d5 - Initial popagent baseline by AkurAI Build
import { beforeAll, describe, expect, test } from "bun:test";
import { AgentRuntimeSettingsStore } from "./agent-runtime-settings";
const store = new AgentRuntimeSettingsStore();
beforeAll(() => store.init());
describe("AgentRuntimeSettingsStore", () => {
test("persists every configurable execution bound", async () => {
const original = await store.get();
const input = {
defaultModel: original.defaultModel,
supervisorMaxSteps: original.supervisorMaxSteps === 23 ? 24 : 23,
specialistMaxSteps: original.specialistMaxSteps === 11 ? 12 : 11,
toolConcurrency: original.toolConcurrency === 2 ? 3 : 2,
delegationContextMessages: original.delegationContextMessages === 9 ? 10 : 9,
delegationResultCharacters: original.delegationResultCharacters === 12_345 ? 12_346 : 12_345,
maxProcessorRetries: original.maxProcessorRetries === 2 ? 3 : 2,
finalResponseFeedback: `Configured final response ${crypto.randomUUID()}`,
delegationFailureFeedback: `Configured failure for {{agentId}}: {{error}} ${crypto.randomUUID()}`,
delegationResultTruncationMarker: `\n[configured truncation ${crypto.randomUUID()}]`,
taskConcurrency: original.taskConcurrency === 2 ? 3 : 2,
taskPollIntervalMs: original.taskPollIntervalMs === 2_500 ? 3_000 : 2_500,
taskTimeoutMs: original.taskTimeoutMs === 120_000 ? 180_000 : 120_000,
taskStaleAfterMs: original.taskStaleAfterMs === 7_200_000 ? 10_800_000 : 7_200_000,
};
try {
expect(await store.update(input)).toMatchObject(input);
expect(await new AgentRuntimeSettingsStore().get()).toMatchObject(input);
} finally {
await store.update(original);
}
});
});