Merge pull request #164 from elder-plinius/fix/163-minimal-pipeline-cancellation

fix(pipeline): tolerate missing cancellation state
This commit is contained in:
Joseph Magly
2026-08-24 14:39:54 -04:00
committed by GitHub
3 changed files with 11 additions and 3 deletions
+3 -1
View File
@@ -83,6 +83,7 @@
"tests/test_offload_surgery.py",
"tests/test_persistence_contracts.py",
"tests/test_persistence_pipeline.py",
"tests/test_telemetry.py",
"tests/conditional/test_cuda_runtime.py",
"tests/conditional/test_jetson_runtime.py"
]
@@ -551,7 +552,8 @@
"tests/test_persistence_contracts.py",
"tests/test_persistence_pipeline.py",
"tests/test_projection_math_contracts.py",
"tests/test_offline_integration.py"
"tests/test_offline_integration.py",
"tests/test_telemetry.py"
],
"conditional_gates": [
"model-download-runtime"
+3 -2
View File
@@ -1189,8 +1189,9 @@ class AbliterationPipeline:
self._cancellation_event.set()
def _check_cancelled(self, stage: str | None = None) -> None:
if self._cancellation_event.is_set():
active_stage = stage or self._active_stage
cancellation_event = getattr(self, "_cancellation_event", None)
if cancellation_event is not None and cancellation_event.is_set():
active_stage = stage or getattr(self, "_active_stage", "pipeline")
raise PipelineCancelledError(
f"Pipeline cancelled during {active_stage.upper()}.",
stage=active_stage,
+5
View File
@@ -297,6 +297,11 @@ class TestPipelineInit:
assert pipeline.handle.model is None
assert pipeline.handle.tokenizer is None
def test_cancellation_check_treats_missing_event_as_not_cancelled(self):
pipeline = AbliterationPipeline.__new__(AbliterationPipeline)
pipeline._check_cancelled("verify")
def test_public_run_cleans_up_terminal_pipeline_failure(self, monkeypatch):
from obliteratus.abliterate import PipelineValidationError