refactor(agent): delegate recovery channel eligibility to admission

This commit is contained in:
chengyongru authored and chengyongru committed 2026-10-30 18:31:05 +08:00
1 parent 29d0023fca
commit 3e40684112
4 files changed
+43 -23

No files matched your search

+6 -1
View File
@@ -50,7 +50,12 @@ def request_origin_from_metadata(metadata: Mapping[str, Any]) -> RequestOrigin |
class RecoveryAdmission(Protocol):
"""Narrow AgentLoop boundary for explicit recovery validation."""
"""Own recovery eligibility before queue injection and worker dispatch.
Messages carry their effective session key and may come from any channel.
Implementations must tolerate repeated admission. Admission may cancel an
active worker, so callers must re-read queue ownership afterwards.
"""
async def admit(self, message: InboundMessage) -> bool: ...