feat(backend): 협상 채팅(chat) API + agent 위임

- /v1/negotiation/sessions/{id}/chat/{init,messages,send} 추가
- agent(9500) 위임 어댑터(IAgentClient) + mock(use_mock) 격리 → agent 미연동 시 1402 graceful degrade
- negotiation.chats 메시지 영속화(meta JSONB) + 종료 시 세션 입찰/거부 확정(단일 트랜잭션)
- 동시전송 가드(유저 메시지 pre-claim/CHAT_IN_PROGRESS) + 실패 시 롤백, 마감/만료 분기, init 만료 정리
- ChatSender enum, chat 에러코드(1400~1403), chats ORM 모델, AgentConfig
- 테스트 10건(test_chat.py), AGENT_INTEGRATION.md 연동 규약 문서

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
민헌andClaude Opus 4.8 committed 2026-06-18 14:24:57 +09:00
1 parent d199c1dec1
commit dcce82a630
14 files changed
+1124 -2

No files matched your search

+2
View File
@@ -11,6 +11,7 @@ from common.utils.gtime import GTime
from config.server_configs import web_server_config
import router.v1.auth.account
import router.v1.negotiation.session
import router.v1.negotiation.chat
API_SERVER_START_TIME = GTime.UTCStr()
@@ -57,3 +58,4 @@ async def healthz():
# 각 도메인 라우터를 등록한다. 새 기능 추가 시 router.v1.<domain>.<file> 를 import 후 include.
app.include_router(router.v1.auth.account.router)
app.include_router(router.v1.negotiation.session.router)
app.include_router(router.v1.negotiation.chat.router)