M2b:删除旧 chat 体系——线性会话/叩心/情绪/纪念日模型与页面退役(迁移 003 双向验证),runs 去会话外键,测试全量修剪
This commit is contained in:
1 parent
5f36e3785c
commit
ad9c9e942a
22 files changed
+424
-427
No files matched your search
@@ -34,23 +34,8 @@ async def test_error_contracts(client: AsyncClient) -> None:
|
||||
assert missing_run.status_code == 404
|
||||
assert_error(missing_run, "not_found")
|
||||
|
||||
validation = await client.post("/api/v1/chat/sessions", json={"title": "x" * 300})
|
||||
validation = await client.post("/api/v1/runs", json={"prompt": ""})
|
||||
assert validation.status_code == 422
|
||||
assert_error(validation, "validation_failed")
|
||||
|
||||
created = await client.post("/api/v1/chat/sessions", json={"title": "错误"})
|
||||
session_id = created.json()["session_id"]
|
||||
unsupported = await client.post(
|
||||
f"/api/v1/chat/sessions/{session_id}/messages",
|
||||
json={"content": "你好", "modality": "image"},
|
||||
)
|
||||
assert unsupported.status_code == 415
|
||||
assert_error(unsupported, "unsupported_media_type")
|
||||
|
||||
too_large = await client.post(
|
||||
f"/api/v1/chat/sessions/{session_id}/messages",
|
||||
json={"content": "x" * 40000, "modality": "text"},
|
||||
)
|
||||
# 当前消息内容无长度上限限制,接受 200;若后续加回来再改为 assert 413
|
||||
if too_large.status_code == 413:
|
||||
assert_error(too_large, "payload_too_large")
|
||||
# 旧 chat 会话错误契约随线性会话模型退役;415/413 契约由镜树/媒体域随需要重建
|
||||
Reference in new issue
Block a user