袁聪的第二次提交,项目已完整

This commit is contained in:
2026-09-11 16:57:47 +08:00
parent 5907fcd6d2
commit fd9598efdf
190 changed files with 31513 additions and 680 deletions
@@ -35,16 +35,21 @@ async def test_http_accept_worker_commit_query_and_repeat(acceptance_registry, r
async with httpx.AsyncClient(transport=httpx.ASGITransport(app=app),
base_url="http://test") as client:
try:
# 消息必须携带受控持久事实信号(`MemoryService.detect_memory_signals`):记忆抽取
# 已按策略门控,"只记持久事实/偏好",普通问答不再触发,否则本用例的
# `memory.extraction_requested` 断言与产品行为矛盾。
response = await client.post("/api/v1/agent-runs", json={
"agent_type": "customer_service", "message": "hello runtime",
"agent_type": "customer_service",
"message": "hello runtime,我的风险偏好是稳健型",
"session_id": session_id, "idempotency_key": str(uuid4()),
})
assert response.status_code == 202
run_id = response.json()["run_id"]
# 文档 §3.3 + §19:成功响应统一为 {data, meta} 信封。
run_id = response.json()["data"]["run_id"]
assert await runtime.dispatch_one(run_id=run_id)
assert not await runtime.dispatch_one(run_id=run_id)
await asyncio.gather(runtime.execute(run_id), runtime.execute(run_id))
result = (await client.get(f"/api/v1/agent-runs/{run_id}")).json()
result = (await client.get(f"/api/v1/agent-runs/{run_id}")).json()["data"]
assert result["status"] == ("failed" if revoked else "succeeded")
if not revoked:
assert result["result"]["content"] == "test result"