This commit changes the revision identifier from '0020_backfill_all_missing_columns' to '0020_backfill_missing_schema' to better reflect the purpose of the migration, which focuses on backfilling missing schema elements in the database.
This migration updates the database schema by automatically adding all missing columns from the ORM models to the existing tables. It replaces the previous specific addition of 'tts_audio_urls' with a more comprehensive approach that inspects the ORM metadata and synchronizes it with the database schema. The downgrade function has been simplified to a no-op.
This migration introduces the 'tts_audio_urls' column to both the 'segments' and 'conversation_messages' tables, addressing a discrepancy between the ORM model and the production database. The upgrade function checks for the existence of these columns and adds them if they are missing, while the downgrade function allows for their removal if necessary.
Introduced two new markdown files detailing the product overview, core functionalities, data security measures, user experience, and collaboration models for the "岁月留书" application. This documentation aims to provide clear insights for potential users and partners in the elder care sector.
Correct the regex in the Docker deployment workflow to properly validate environment variable placeholders. Additionally, update the staging environment configuration by adding specific keys and values for Tencent Cloud services, ensuring proper setup for deployment.
This migration adds the columns 'audio_duration_seconds' to the 'segments' table and 'deleted_at' to the 'conversations' table, which were previously missing in the production database. The upgrade function checks for the existence of these columns and adds them if they are not present. The downgrade function allows for the removal of these columns if necessary.
Add retries for ssh-keyscan and fall back to non-strict host checking for transient network failures so reruns do not fail early before deployment steps.
Co-authored-by: Cursor <cursoragent@cursor.com>
Allow staging deployments to expose /api/auth/mock/sms-login by reading APP_ENV from runtime env and setting staging APP_ENV plus MOCK_SMS_LOGIN_ENABLED in staging env config.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Extract maybe_send_topic_chips_ws for WS connect + pipeline reuse
- Default memoir stage to childhood when empty for chip bank lookup
- Resend suggestions after normal assistant reply (English/Chinese)
Co-authored-by: Cursor <cursoragent@cursor.com>
- Pipeline: skip _send_tts_audio only for non-manual when ENABLE_TTS=false;
remove enable_tts early return from handle_tts_request_on_demand.
- Tencent TTS: PrimaryLanguage/chunking follow user language preference only.
- Expo: let manual tts_audio bypass late-segment playback gate after interrupt.
- Docs: clarify ENABLE_TTS vs tts_request in api/.env.example and TTSProvider port.
- Tests: add manual bypass cases; adjust pipeline language tests for en+Chinese text.
Co-authored-by: Cursor <cursoragent@cursor.com>
Two complementary changes to reduce conversation cold-start friction:
A. Returning-user re-greeting (backend)
- When WS reconnects to a non-empty conversation and last_message_at is older
than chat_re_greeting_idle_hours (default 6h), the agent emits a warm
continuation message that references prior history instead of staying silent.
- Self-debouncing: the AI message updates last_message_at, so reconnects
within the window will not re-trigger.
- Skipped while profile collection is still pending.
D. Topic suggestion chips (backend + Expo)
- New WS message type topic_suggestions carries 3-4 quick-start chips derived
from the current memoir stage's empty slots (deterministic, no extra LLM
cost). Sent alongside opening / re-greeting / resume.
- Expo chat screen renders a horizontally-scrollable chip row above the input
bar; tapping a chip sends the chip's text as a user message and clears the
row. Sending any text/voice also clears the chips.
Prefetch opening over WebSocket from the conversations list before navigation, with prepared-session handoff into the chat screen. Add a single-slot background pool so leaving chat (in-app) keeps the last session socket with UI callbacks stripped; dispose on app background and reconnect after resume when the chat screen is mounted. Tear down pooled sockets on logout, purge, and conversation delete. RealtimeSession supports attachUiCallbacks and idempotent dispose, and the chat composer hides the connection notice while connecting if assistant history already exists. Fix pause handler wiring in the conversation screen.
Co-authored-by: Cursor <cursoragent@cursor.com>