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.
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.
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.
Interview/chat prompt layers, reply planner, style profiles, memory
injection, interview meta store, and related tests. Work not finished.
Made-with: Cursor
- Add plan_interview_turn: emotion_first / memoir_push / follow_user_only
- Inject hard directive block at top of guided system prompt
- Pass stage_switched_this_turn from ChatOrchestrator after stage detection
- Log interview_turn_plan for observability; add unit tests
- Add strip_parenthetical_asides_for_chat in reply pipeline before [SPLIT]
- Expand output_rules bans (performance parens) and voice as warm host
- Refocus opening/guided prompts on pulling conversation toward memoir oral history
- Align interview opening fallbacks with memoir-first tone
- Add unit tests for parenthetical stripping