Commit Graph
28 Commits
Author SHA1 Message Date
stefanfeng 81aec1c63a feat(avatar): support production H5 token SSO 2026-08-26 09:17:41 +08:00
stefanfeng dc34a03357 feat(ai): add dedicated digital avatar model config 2026-08-25 16:50:33 +08:00
stefanfeng 699bbbde57 feat(avatar): add user token accounting 2026-08-25 13:24:02 +08:00
stefanfeng 672019830d fix(avatar): prevent takeover replies blocking across chats 2026-08-21 16:21:00 +08:00
stefanfeng e720baa21e fix(avatar): batch knowledge embedding requests 2026-08-21 13:21:05 +08:00
stefanfeng e2b928273c fix(avatar): acknowledge BOXIM messages as read 2026-08-20 17:10:54 +08:00
stefanfeng 64b7680ec4 fix(avatar): keep BOXIM status ready during long polls 2026-08-20 15:58:07 +08:00
stefanfeng 76bd22c24b fix(avatar): preserve ownership across Huihui environments 2026-08-20 15:27:29 +08:00
stefanfeng 51a317ccd9 fix(avatar): fail closed on BOXIM connection errors 2026-08-20 14:47:13 +08:00
stefanfeng 25fb8fbee5 feat(avatar): add BOXIM chat takeover 2026-08-19 17:56:57 +08:00
stefanfeng cfcfe7146e feat(avatar): align authorization page with design 2026-08-19 17:05:22 +08:00
stefanfeng 2e2adeb9e2 feat(avatar): complete authorization management 2026-08-19 16:21:19 +08:00
stefanfeng 25d2494616 fix: surface missing knowledge files 2026-08-19 15:13:22 +08:00
stefanfeng 68ea87e1b2 fix: persist avatar data and uploads 2026-08-19 14:44:58 +08:00
stefanfeng c5bfa47a23 fix: await takeover polling jobs 2026-08-19 14:32:10 +08:00
stefanfeng 4ab7732da9 fix: preserve takeover and share token integrity 2026-08-19 14:23:43 +08:00
stefanfeng 4a2d788e85 feat: complete grounded digital avatar chat experience 2026-08-19 14:21:56 +08:00
stefanfeng c748950402 fix: accept camelCase authorizationId from frontend 2026-08-07 17:18:34 +08:00
stefanfeng f13d488f82 feat: add takeover config API endpoint
PUT /api/avatar/{avatar_id}/authorizations/takeover to update authorization
takeover settings (enabled, mode, delay_seconds) with validation.
2026-08-07 17:15:12 +08:00
stefanfeng 8e365e63e1 feat: add scheduled message polling for avatar takeover
Add APScheduler BackgroundScheduler to on_startup that polls
takeover_service.poll_and_process_messages every 10 seconds. Added
redis and apscheduler dependencies. Added poll_and_process_messages,
fetch_unread_messages, and process_message methods to TakeoverService.
Scheduler initialization is graceful — Redis/Box IM failures do not
prevent app startup.
2026-08-07 17:01:04 +08:00
stefanfeng dbd668e451 fix: resolve owner through Avatar model in takeover service
- Fix C1: check_takeover_enabled now uses owner_huihui_id to query Avatar first
- Fix C2: execute_takeover resolves owner_id via Avatar model (Authorization has no owner_id)
- Fix I1: add test for None case (no Avatar found)
- Fix I2: add test verifying filter arguments
- Fix I3: implement process_delayed_queue to scan and dispatch expired messages
2026-08-07 16:55:25 +08:00
stefanfeng 190ec48d9c feat: add takeover service core logic
Implement TakeoverService for avatar takeover chat feature:
- check_takeover_enabled: query Authorization for enabled takeover
- generate_reply: call local chat API via httpx to generate responses
- execute_takeover: get owner IM credentials, generate reply, send via BoxIM
- enqueue_delayed_message: Redis delayed queue with graceful degradation
- process_delayed_queue: placeholder for scheduled worker

Service degrades gracefully when Redis is unavailable.
2026-08-07 16:46:57 +08:00
stefanfeng 0cc43a0d8c fix: exclude signature from signing string in BoxIMClient
Prevents stale signature values from leaking into the MD5 signing
calculation, matching the news_service.py pattern. Adds a test that
passes a stale signature in extra params and verifies the returned
signature is freshly computed.
2026-08-07 16:42:00 +08:00
stefanfeng 43bb57eacf feat: add Box IM client for Netease Yunxin integration
Add BoxIMClient with get_credentials and send_p2p_message methods,
using Huihui platform MD5 signing mechanism (sorted keys, 24h timestamp,
12-char alphanumeric nonce). Includes full test coverage.
2026-08-07 16:36:50 +08:00
stefanfeng 7327939b4d feat: add takeover fields to Authorization model
Add takeover_enabled, takeover_mode, and takeover_delay_seconds columns
to the Authorization model with a SQLite migration, and include them
in to_dict(). Test: test_takeover_model.py.
2026-08-07 16:30:29 +08:00
stefanfeng e3cce871b0 fix: add avatar photo upload endpoint to digital-avatar-app backend
- Add POST /api/avatar/{id}/photo endpoint
- Save uploaded photos to UPLOAD_DIR/{avatar_id}/
- Update avatar.photo_url in database
- Import UPLOAD_DIR from knowledge router
2026-08-07 15:10:59 +08:00
stefanfeng e3bda469bb feat: complete huihui square avatar workflows 2026-07-24 14:04:21 +08:00
stefanfeng 2d9f26a6f0 feat: add avatar chat and knowledge workflow 2026-07-23 17:21:49 +08:00