Spaces:
Running
Running
A2-R1 Scoped GenerationRunner Cancellation Contract Fix
#103
by GuXiaopeng - opened
core/generation_runner.py
CHANGED
|
@@ -1247,7 +1247,8 @@ class GenerationRunner:
|
|
| 1247 |
passes = max(1, int((APP_CONFIG.get("adaptive_completion") or {}).get("section_repair_passes", 2)))
|
| 1248 |
scopes = ("paragraph", "section", "section")
|
| 1249 |
for idx in range(passes):
|
| 1250 |
-
self.
|
|
|
|
| 1251 |
repaired = agent.adaptive_repair_academic_unit(
|
| 1252 |
current, violations=remaining, section_id=section_id, section_name=section_name,
|
| 1253 |
mode=mode, study_evidence=study_evidence, evidence_contract=evidence_contract,
|
|
|
|
| 1247 |
passes = max(1, int((APP_CONFIG.get("adaptive_completion") or {}).get("section_repair_passes", 2)))
|
| 1248 |
scopes = ("paragraph", "section", "section")
|
| 1249 |
for idx in range(passes):
|
| 1250 |
+
if self.cancel_checker():
|
| 1251 |
+
raise RuntimeError("task_cancel_requested")
|
| 1252 |
repaired = agent.adaptive_repair_academic_unit(
|
| 1253 |
current, violations=remaining, section_id=section_id, section_name=section_name,
|
| 1254 |
mode=mode, study_evidence=study_evidence, evidence_contract=evidence_contract,
|