Q195: a change reloads only what is not already shown, and the snapshot stops carrying records the window never reads

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-09 09:20:45 -04:00
1 parent 2f79e4261f
commit 56eac39b1b
31 files changed
+146 -214

No files matched your search

@@ -1,3 +1,4 @@
import { tableRows } from "../helpers/table-rows";
import { randomUUID } from "node:crypto";
import { tmpdir } from "node:os";
import { join } from "node:path";
@@ -5,7 +6,6 @@ import { describe, expect, test } from "vitest";
import { DatabaseConnection } from "../../src/main/database/connection";
import { OrganizationService } from "../../src/main/services/organization-service";
import { parseProviderRateLimitHeaders, ProviderRateLimitRegistry } from "../../src/main/services/provider-rate-limit-registry";
import { SnapshotService } from "../../src/main/services/snapshot-service";
function createConnection(): DatabaseConnection {
return new DatabaseConnection(join(tmpdir(), `agentcompany-provider-rate-limits-${randomUUID()}.db`));
@@ -52,7 +52,6 @@ describe("provider rate limit registry", () => {
test("persists observed quota state into snapshots", () => {
const connection = createConnection();
const organization = new OrganizationService(connection.db);
const snapshot = new SnapshotService(connection.db);
const registry = new ProviderRateLimitRegistry(connection.db);
let orgId = "";
let openAiProviderId = "";
@@ -75,7 +74,7 @@ describe("provider rate limit registry", () => {
});
});
expect(snapshot.load().providerRateLimitObservations[0]).toMatchObject({
expect(tableRows(connection.db, "provider_rate_limit_observations", "observed_at desc")[0]).toMatchObject({
orgId,
providerId: openAiProviderId,
providerKey: "openai",