fix(coach): make remembering reliable and survivable

A remember action under every persisted chat message adopts its content
into the matching self-context field — allergy statements land in
allergies, diagnosis wording in conditions, everything else in the
coach focus — reusing the adopt endpoint's dedupe and encryption, with
the result visible and editable where the self-context lives. The
deterministic fact patterns accept closed filler-word and possessive
variants that previously defeated them, and stored facts survive the
snapshot budget squeeze instead of being the first block shed on
data-rich accounts.
This commit is contained in:
Marc-André Bombeck committed 2026-06-11 21:52:51 +02:00
1 parent 242d2514ee
commit a664395021
9 files changed
+387 -40

No files matched your search

+10 -2
View File
@@ -54,10 +54,18 @@ export type AboutMePutInput = z.infer<typeof aboutMePutSchema>;
* stored self-context. The server picks the matching structured field
* from the question wording, dedupes against the stored text, and
* appends encrypted.
*
* v1.16.8 — `question` is optional: the remember action on a Coach
* chat message sends only the message text, and the server matches the
* target field from the text itself.
*/
export const aboutMeAdoptSchema = z.object({
/** The clarifying question the answer belongs to (field matching). */
question: z.string().trim().min(1).max(500),
/**
* The clarifying question the answer belongs to (field matching).
* Absent for the message-remember path — the field is then matched
* from the answer text.
*/
question: z.string().trim().min(1).max(500).optional(),
/** The user's answer, as typed into the Coach composer. */
answer: z.string().trim().min(1).max(ABOUT_ME_FIELD_MAX_CHARS),
});