fix: isolate user concurrency from internal agent runs

This commit is contained in:
吉鑫升 committed 2026-06-30 14:56:29 +08:00
1 parent 124eb04a6b
commit c23350f17b
8 files changed
+162 -10

No files matched your search

@@ -273,6 +273,7 @@ class RunManager:
if r.status in (RunStatus.pending, RunStatus.running)
and str((r.metadata or {}).get("model_name") or "").strip() == model_name
and str((r.metadata or {}).get("user_id") or "").strip() == user_id
and str((r.metadata or {}).get("run_scope") or "external_root").strip() == "external_root"
)
if active_for_user_model >= max(1, int(limit)):
raise ModelConcurrencyLimitError(model_name, limit, scope="user_model", user_id=user_id)