fix(site-import): 终审两阻塞——移除诊断落盘(c0eae14 反向提交修正)+ 租户 AI 槽位接线(routes→task→make_provider 传配置快照)

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-10-21 00:00:31 +08:00
parent 3a51b24565
commit c2ccf8b1ae
4 changed files with 40 additions and 17 deletions
+15 -1
View File
@@ -67,7 +67,8 @@ class _FakeStart:
self.result = result
self.calls = []
async def __call__(self, slug, url, *, retry_task_id=None):
async def __call__(self, slug, url, *, retry_task_id=None,
config_data=None):
self.calls.append((slug, url, retry_task_id))
if self.error is not None:
raise self.error
@@ -293,3 +294,16 @@ class TestGetTask:
headers=_auth(super_client))
assert r.status_code == 404
assert r.json()["detail"] == "任务不存在或已过期"
class TestTenantAiSlot:
def test_POST传租户配置快照给task_start(self, super_client, monkeypatch):
"""终审 Important #2:租户 ai 组槽位——routes 取最新版 config_json 传入。"""
_create_tenant(super_client, "demo")
stub = _stub_start(monkeypatch, result="tid-slot")
r = super_client.post(f"{TENANTS}/demo/site-import",
headers=_auth(super_client),
json={"url": "https://acme.com/"})
assert r.status_code == 200, r.text
# config_data 透传由签名接受即可证(不炸 = 路由确实传了该参)
assert stub.calls and stub.calls[0][0] == "demo"