修复:CI 部署环境与 ref 错配、迁移碎片化、图片意图 source_span、章节物化脏版式、会话历史与本地语音不一致

新增:TTS 上传 COS 与分片、章节 reading_segments 物化与快照、markdown 清洗、会话消息 repository、语音 store 重构与相关测试
This commit is contained in:
Kevin
2026-03-20 16:36:42 +08:00
parent 7317bf10cd
commit 8af37e5e8e
65 changed files with 1704 additions and 504 deletions

View File

@@ -39,6 +39,19 @@ class SegmentsToRedisHistoryTest(unittest.TestCase):
self.assertEqual(h[0]["messageType"], "audio")
self.assertEqual(h[0]["voiceSessionId"], "vs-9")
def test_voice_segment_includes_duration_seconds_when_set(self):
seg = Segment(
id="s1",
conversation_id="c1",
transcript_text="",
audio_url="audio-segment:vs-9:0",
audio_duration_seconds=12,
created_at=datetime(2024, 1, 2, tzinfo=timezone.utc),
agent_response=None,
)
h = segments_to_redis_history([seg])
self.assertEqual(h[0]["durationSeconds"], 12)
if __name__ == "__main__":
unittest.main()