mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-15 15:02:04 +00:00
refactor(ai): keep one name for one completion's ceiling
A status run is one completion, so its ceiling was the completion ceiling under a second name. The Local client also re-exported a JSON-mode helper nobody imported from it.
This commit is contained in:
1 parent
8fee138256
commit
240a135b88
7 files changed
+14
-22
No files matched your search
@@ -55,7 +55,6 @@ import { QUEUE_RUNTIME, type QueueRuntime } from "@/lib/jobs/queue-runtime";
|
||||
import {
|
||||
COMPLETION_CEILING_MS,
|
||||
COMPREHENSIVE_WARM_CEILING_MS,
|
||||
STATUS_RUN_CEILING_MS,
|
||||
} from "@/lib/jobs/model-time";
|
||||
import {
|
||||
COMPREHENSIVE_MODEL_CALLS,
|
||||
@@ -147,7 +146,7 @@ function modelSecondsOf(runs: {
|
||||
completions?: number;
|
||||
}) {
|
||||
return (
|
||||
((runs.status ?? 0) * STATUS_RUN_CEILING_MS +
|
||||
((runs.status ?? 0) * COMPLETION_CEILING_MS +
|
||||
(runs.comprehensive ?? 0) * COMPREHENSIVE_WARM_CEILING_MS +
|
||||
(runs.completions ?? 0) * COMPLETION_CEILING_MS) /
|
||||
1000
|
||||
@@ -204,7 +203,7 @@ describe("jobs that wait on the response timeout outlast it", () => {
|
||||
});
|
||||
|
||||
it("sizes the run ceilings from the largest setting and the call counts", () => {
|
||||
expect(STATUS_RUN_CEILING_MS).toBe(
|
||||
expect(COMPLETION_CEILING_MS).toBe(
|
||||
AI_RESPONSE_TIMEOUT_MAX_SECONDS * 1000 * STATUS_MODEL_CALLS,
|
||||
);
|
||||
expect(COMPREHENSIVE_WARM_CEILING_MS).toBeGreaterThan(
|
||||
@@ -238,14 +237,14 @@ describe("jobs that wait on the response timeout outlast it", () => {
|
||||
},
|
||||
"coach-memory-refresh": {
|
||||
runtime: "bounded",
|
||||
modelSeconds: STATUS_RUN_CEILING_MS / 1000,
|
||||
modelSeconds: COMPLETION_CEILING_MS / 1000,
|
||||
expireInSeconds: 1400,
|
||||
expiryVia: [],
|
||||
why: "planted: one run counted instead of three",
|
||||
},
|
||||
};
|
||||
expect(findings(before)).toEqual([
|
||||
`coach-memory-refresh: model time ${STATUS_RUN_CEILING_MS / 1000}s below the ${modelSecondsOf({ status: 3 })}s its runs take`,
|
||||
`coach-memory-refresh: model time ${COMPLETION_CEILING_MS / 1000}s below the ${modelSecondsOf({ status: 3 })}s its runs take`,
|
||||
"morning-digest-refresh: declared short, but it waits on the person's response timeout",
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user