mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 15:23:29 +00:00
Merge branch 'fix/v1394-review-correctness' into release/v1.39.4
This commit is contained in:
commit
c7e53176c1
112 files changed
+4330
-732
No files matched your search
@@ -70,7 +70,6 @@ export const POST = apiHandler(
|
||||
userId: user.id,
|
||||
occurredAt: existing.occurredAt,
|
||||
practitionerName: existing.practitioner?.name ?? null,
|
||||
practitionerLocation: existing.practitioner?.location ?? null,
|
||||
kindLabel: encounterKindLabel(existing.kind, locale),
|
||||
},
|
||||
timezone,
|
||||
|
||||
@@ -130,7 +130,6 @@ export const PATCH = apiHandler(
|
||||
const visible = await actingDomainVisibility(tx, grantId);
|
||||
let practitionerId = existing.practitionerId;
|
||||
let practitionerName: string | null = null;
|
||||
let practitionerLocation: string | null = null;
|
||||
|
||||
if (entry.practitionerId !== undefined) {
|
||||
if (entry.practitionerId === null) {
|
||||
@@ -144,7 +143,6 @@ export const PATCH = apiHandler(
|
||||
if (!resolved) return "unknown-practitioner" as const;
|
||||
practitionerId = resolved.id;
|
||||
practitionerName = resolved.name;
|
||||
practitionerLocation = resolved.location;
|
||||
}
|
||||
} else if (practitionerId) {
|
||||
const resolved = await resolveOwnedPractitioner(
|
||||
@@ -153,7 +151,6 @@ export const PATCH = apiHandler(
|
||||
practitionerId,
|
||||
);
|
||||
practitionerName = resolved?.name ?? null;
|
||||
practitionerLocation = resolved?.location ?? null;
|
||||
}
|
||||
|
||||
const data: Prisma.EncounterUpdateInput = {};
|
||||
@@ -206,7 +203,6 @@ export const PATCH = apiHandler(
|
||||
userId: user.id,
|
||||
occurredAt: nextOccurredAt,
|
||||
practitionerName,
|
||||
practitionerLocation,
|
||||
kindLabel: encounterKindLabel(entry.kind ?? existing.kind, locale),
|
||||
status: nextStatus,
|
||||
existingReminderId: ownAppointmentReminderId,
|
||||
@@ -222,7 +218,6 @@ export const PATCH = apiHandler(
|
||||
userId: user.id,
|
||||
occurredAt: nextOccurredAt,
|
||||
practitionerName,
|
||||
practitionerLocation,
|
||||
kindLabel: encounterKindLabel(entry.kind ?? existing.kind, locale),
|
||||
status: nextStatus,
|
||||
existingReminderId: ownAppointmentReminderId,
|
||||
|
||||
@@ -195,8 +195,7 @@ async function postEncounter(request: NextRequest): Promise<Response> {
|
||||
// A practitioner the caller does not own is a refusal rather than a
|
||||
// silently dropped field: the person named a practice and would otherwise
|
||||
// see the visit save without it.
|
||||
let practitioner:
|
||||
{ id: string; name: string; location: string | null } | undefined;
|
||||
let practitioner: { id: string; name: string } | undefined;
|
||||
if (entry.practitionerId) {
|
||||
practitioner = await resolveOwnedPractitioner(
|
||||
tx,
|
||||
@@ -241,7 +240,6 @@ async function postEncounter(request: NextRequest): Promise<Response> {
|
||||
userId: user.id,
|
||||
occurredAt,
|
||||
practitionerName: practitioner?.name ?? null,
|
||||
practitionerLocation: practitioner?.location ?? null,
|
||||
kindLabel: encounterKindLabel(entry.kind, locale),
|
||||
status: entry.status,
|
||||
existingReminderId: null,
|
||||
|
||||
@@ -50,7 +50,7 @@ exports[`coach chat golden transcripts > 01a tool mode, two rounds, present data
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -251,7 +251,7 @@ exports[`coach chat golden transcripts > 01b tool mode, present data, one figure
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -464,7 +464,7 @@ exports[`coach chat golden transcripts > 02 tool mode, every tool missed, fabric
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -1162,7 +1162,7 @@ exports[`coach chat golden transcripts > 07a all providers failed (plain) 1`] =
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -1251,7 +1251,7 @@ exports[`coach chat golden transcripts > 07b all providers failed (every hop rat
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -1340,7 +1340,7 @@ exports[`coach chat golden transcripts > 07c all providers failed (primary crede
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -1429,7 +1429,7 @@ exports[`coach chat golden transcripts > 08 an unwrapped tagged provider error 1
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -1519,7 +1519,7 @@ exports[`coach chat golden transcripts > 09 an aborted request leaves a cancelle
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -1615,7 +1615,7 @@ exports[`coach chat golden transcripts > 10 outbound block replaces the reply an
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -1946,7 +1946,7 @@ exports[`coach chat golden transcripts > 11a KEYVALUES valid 1`] = `
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -2151,7 +2151,7 @@ exports[`coach chat golden transcripts > 11b KEYVALUES partial 1`] = `
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -2354,7 +2354,7 @@ exports[`coach chat golden transcripts > 11c KEYVALUES malformed (no closing mar
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -2541,7 +2541,7 @@ exports[`coach chat golden transcripts > 11d sentinel-only reply is an empty rep
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -2630,7 +2630,7 @@ exports[`coach chat golden transcripts > 11e empty provider reply 1`] = `
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -2710,7 +2710,7 @@ exports[`coach chat golden transcripts > 12a SUGGEST-REMINDER surfaced 1`] = `
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -2935,7 +2935,7 @@ exports[`coach chat golden transcripts > 12b SUGGEST-REMINDER suppressed 1`] = `
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -3124,7 +3124,7 @@ exports[`coach chat golden transcripts > 13 SUGGEST-ACTION 1`] = `
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -3353,7 +3353,7 @@ exports[`coach chat golden transcripts > 14a REMEMBER valid 1`] = `
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -3562,7 +3562,7 @@ exports[`coach chat golden transcripts > 14b REMEMBER malformed 1`] = `
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -3766,7 +3766,7 @@ exports[`coach chat golden transcripts > 15 an unknown learn link is scrubbed, a
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -4298,7 +4298,7 @@ exports[`coach chat golden transcripts > 17a a workout-scoped first turn 1`] = `
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -4508,7 +4508,7 @@ exports[`coach chat golden transcripts > 17b a workout-scoped first turn with th
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -4697,7 +4697,7 @@ exports[`coach chat golden transcripts > 18 a persistence throw after the provid
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -4790,7 +4790,7 @@ exports[`coach chat golden transcripts > 19 an existing conversation with prior
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -5003,7 +5003,7 @@ exports[`coach chat golden transcripts > 20 a guided-question turn with a scope
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 30000,
|
||||
"tools": 2,
|
||||
@@ -5172,7 +5172,7 @@ exports[`coach chat golden transcripts > 21 the German locale with a stored self
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "e297a082792b:4728",
|
||||
"system": "c61eecc94d49:3280",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
@@ -5377,7 +5377,7 @@ exports[`coach chat golden transcripts > 22 tool mode with live steps: found, em
|
||||
"window": "last30days",
|
||||
},
|
||||
"signal": true,
|
||||
"system": "ca96f6408388:4509",
|
||||
"system": "4a4d00f5a344:3187",
|
||||
"temperature": 0.4,
|
||||
"timeoutMs": 180000,
|
||||
"tools": 2,
|
||||
|
||||
@@ -169,7 +169,7 @@ describe("POST /api/insights/chat — fence guard", () => {
|
||||
expect(fetchConversationWithMessages).toHaveBeenCalledWith(
|
||||
"u1",
|
||||
"fenced-conv",
|
||||
{ documentScoped: false },
|
||||
{ documentScoped: false, countEarlierAssistant: true },
|
||||
);
|
||||
expect(auditLog).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -205,11 +205,18 @@ describe("a reuse chip", () => {
|
||||
"result",
|
||||
).map((f) => f.result);
|
||||
expect(result.rows).toEqual(world.storedTables[0].rows);
|
||||
expect(result.chart).toBeNull();
|
||||
// The table shows first; the chart stays, so the chart is offered back.
|
||||
expect(result.view).toBe("table");
|
||||
expect(result.chart).toEqual(world.storedTables[0].chart);
|
||||
expect(result.reusedFrom).toEqual({
|
||||
messageId: h.LAST_ASSISTANT_ID,
|
||||
ref: "r1",
|
||||
});
|
||||
const [chips] = framesOf<{ followUps: CoachFollowUp[] }>(
|
||||
run.frames,
|
||||
"followUps",
|
||||
);
|
||||
expect(chips.followUps.map((c) => c.kind)).toEqual(["as_chart"]);
|
||||
expect(m.appendMessage).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ role: "assistant", providerType: "reuse" }),
|
||||
);
|
||||
@@ -314,7 +321,7 @@ describe("a model chip", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("continues a forced reply with the question it left unfinished", async () => {
|
||||
it("continues a forced reply, pointing at the question it left unfinished", async () => {
|
||||
conversationWithChips();
|
||||
world.storedFollowUps = [{ ...chip("f1", "continue"), anchor: undefined }];
|
||||
world.storedProvenance = {
|
||||
@@ -340,8 +347,11 @@ describe("a model chip", () => {
|
||||
await tap("f1");
|
||||
const system = providerCalls[0].system;
|
||||
expect(system).toContain(
|
||||
'CONTINUE: the person asked you to keep looking. Unfinished answer for: "How was my blood pressure last month?"',
|
||||
"CONTINUE: the person asked you to keep looking. The unfinished question is their message before that request, in CONVERSATION.",
|
||||
);
|
||||
// The question stays the person's own turn; it never reaches the
|
||||
// system role.
|
||||
expect(system).not.toContain("How was my blood pressure last month?");
|
||||
expect(system).toContain(
|
||||
"Already fetched: get_metric_table(bp, last30days, week) → m1.r1",
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user