Commit Graph

7 Commits

Author SHA1 Message Date
7665af0268 feat(bot): quiet finance topics and support purchase payers 2026-03-22 20:27:43 +04:00
afbda43c0e fix(bot): localize topic processor responses and allow optional payment amounts 2026-03-15 02:27:44 +04:00
290b18545e chore(bot): clean up topic processor log levels and add start log 2026-03-14 15:23:12 +04:00
b01a129466 fix(bot): include all schema properties in required array for OpenAI Structured Outputs 2026-03-14 15:04:13 +04:00
8de8419028 feat(bot): enhance topic processor logging for diagnosis
Added comprehensive logging to topic-processor.ts to capture API errors, parsing failures, and silent decisions. Also added result logging to purchase and payment ingestion handlers to trace the processor's output.
2026-03-14 14:54:49 +04:00
572c21f621 feat(bot): add error logging to topic processor
Previously, the topic processor swallowed errors silently, making debugging impossible. This commit adds error logging to the topic processor catch block.
2026-03-14 14:43:32 +04:00
f38ee499ae feat(bot): unified topic processor replacing router+interpreter stack
Replace 3-layer architecture (gpt-5-nano router + gpt-4o-mini interpreter) with
single unified topic processor (gpt-4o-mini) for simplified message handling.

New components:
- HouseholdContextCache: TTL-based caching (5 min) for household config data
- TopicProcessor: Unified classification + parsing with structured JSON output

Key changes:
- Renamed ASSISTANT_ROUTER_MODEL → TOPIC_PROCESSOR_MODEL
- Added TOPIC_PROCESSOR_TIMEOUT_MS (default 10s)
- Refactored save() → saveWithInterpretation() for pre-parsed interpretations
- Removed deprecated createOpenAiTopicMessageRouter and ~300 lines legacy code
- Fixed typing indicator to only start when needed (purchase routes)
- Fixed amount formatting: convert minor units to major for rawText

Routes: silent, chat_reply, purchase, purchase_clarification, payment,
payment_clarification, topic_helper, dismiss_workflow

All 212 bot tests pass. Typecheck, lint, format, build clean.
2026-03-14 13:33:57 +04:00