fix(client): fail closed on polling configuration drift

This commit is contained in:
QiuSW
2026-08-05 01:59:35 +08:00
parent dfd88c3336
commit 3a27225977
6 changed files with 168 additions and 16 deletions
@@ -51,7 +51,7 @@ class ClaimGateway(Protocol):
class ExecutionConsumer(Protocol):
def accept_claim(self, claimed: ClaimedTask) -> None: ...
def accept_claim(self, claimed: ClaimedTask, profile: ProfileSettings) -> None: ...
@dataclass(frozen=True)
@@ -469,9 +469,12 @@ class PollingCoordinator(QObject):
return
try:
consumer = self._consumer
if consumer is None:
frozen_profile = self._frozen_profile
if consumer is None or frozen_profile is None:
raise RuntimeError("execution_consumer_missing")
consumer.accept_claim(claimed)
# consumer 只能使用本次显式 Start 冻结的不可变配置;不得在
# 已领取后回读可变 UI/store,否则 ADB 身份和超时会发生趟内漂移。
consumer.accept_claim(claimed, frozen_profile)
except Exception:
self._request_stop(
PollingState.RECOVERY_REQUIRED,