mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 05:12:14 +00:00
feat(ai): narrow the auto-read consent and refuse the connection test with AI off
Turning document auto-read on now mints an ai_extraction receipt instead of ai_full, so it covers reading documents, lab reports and medication text and no longer opens the Coach or the AI analysis. Receipts minted as ai_full by earlier releases stay valid. The catch-up over stored documents is only scheduled while documentAi is open for the record. The AI connection test is an AI call, so it is refused with assistant.disabled.enabled while the operator's master switch is off, and fails closed with ai.unavailable when the switches cannot be read (403, since the route never answers 5xx). A missing provider carries ai.provider.none and a spent daily budget ai.budget.exceeded.
This commit is contained in:
1 parent
bd8ea9d86b
commit
d239d31311
5 files changed
+263
-30
No files matched your search
@@ -38,7 +38,12 @@
|
||||
*/
|
||||
export const ERROR_CODE_CATALOGUE: Readonly<Record<string, readonly string[]>> =
|
||||
{
|
||||
ai: ["ai.provider.none", "ai.record.notPermitted", "ai.unavailable"],
|
||||
ai: [
|
||||
"ai.budget.exceeded",
|
||||
"ai.provider.none",
|
||||
"ai.record.notPermitted",
|
||||
"ai.unavailable",
|
||||
],
|
||||
ai_provider: ["ai_provider.invalid", "ai_provider.no_fields"],
|
||||
allergy: ["allergy.invalid"],
|
||||
analytics: ["analytics.invalid_query"],
|
||||
@@ -62,6 +67,7 @@ export const ERROR_CODE_CATALOGUE: Readonly<Record<string, readonly string[]>> =
|
||||
],
|
||||
backup: ["backup.payload.undecryptable", "backup.section.missing"],
|
||||
coach: [
|
||||
"coach.budget.exceeded",
|
||||
"coach.conversation.invalidTitle",
|
||||
"coach.conversation.notFound",
|
||||
"coach.fenced.attachmentConflict",
|
||||
|
||||
Reference in new issue
Block a user