feat(agent): refresh assistant model catalog

This commit is contained in:
ginnoir
2026-07-08 19:37:17 -05:00
parent 4dc04b21d6
commit b279f16ba0
6 changed files with 111 additions and 41 deletions
+17
View File
@@ -0,0 +1,17 @@
import assert from "node:assert/strict";
import { describe, it } from "node:test";
describe("GET /api/agent/models", () => {
it("is dynamic and returns no-store responses", async () => {
process.env.DATABASE_URL ??= "postgres://famapp:famapp@localhost:5432/famapp";
const { GET, dynamic } = await import("../../src/app/api/agent/models/route");
assert.equal(dynamic, "force-dynamic");
const response = await GET(new Request("http://localhost/api/agent/models?refresh=1"));
assert.equal(response.status, 401);
assert.equal(response.headers.get("Cache-Control"), "no-store");
});
});