From 232f41a4462cb1ce48c4bc976420ee85e9e858b6 Mon Sep 17 00:00:00 2001 From: unknown <2399365302@qq.com> Date: Tue, 12 May 2026 14:54:22 +0800 Subject: [PATCH] fix(C1): wrap handler call in try/finally to always save progress --- deeptutor/capabilities/guided_learning.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deeptutor/capabilities/guided_learning.py b/deeptutor/capabilities/guided_learning.py index 44cd1ab28..53ede6126 100644 --- a/deeptutor/capabilities/guided_learning.py +++ b/deeptutor/capabilities/guided_learning.py @@ -125,8 +125,10 @@ class GuidedLearningCapability(BaseCapability): await stream.content("学习流程已完成。进入复习阶段。") return - await handler(self, progress, context, stream) - self._service.save(progress) + try: + await handler(self, progress, context, stream) + finally: + self._service.save(progress) # ── §2 Diagnostic ────────────────────────────────────────────────────