From f3b11f973e79cbde18a96194b331a56bbf614c52 Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Wed, 14 Oct 2026 16:41:51 +0200 Subject: [PATCH] fix(runtime): classify a skipped forward as Unsupported, not IdentityMismatch QwenStepTxn::commit folded "no logits/argmax was produced" into the generic `_ => IdentityMismatch` arm of the output match when prefill-finish support was added. The previous guard (and its test full_forward_guard_refuses_skipped_layers_missing_logits_and_wrong_callback_token) distinguished a skipped forward (Unsupported(Executor)) from a wrong callback token (IdentityMismatch). Restore that classification; wrong tokens, and the finish_prefill None path, are unchanged. Co-Authored-By: Claude Sonnet 5.5 --- crates/leleka-runtime/src/qwen_forward/session.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/leleka-runtime/src/qwen_forward/session.rs b/crates/leleka-runtime/src/qwen_forward/session.rs index 8c467cce..6fcd6dc2 100644 --- a/crates/leleka-runtime/src/qwen_forward/session.rs +++ b/crates/leleka-runtime/src/qwen_forward/session.rs @@ -462,6 +462,11 @@ impl<'driver> QwenStepTxn<'_, 'driver> { return Err(Error::Unsupported(Stage::Executor)); } match output { + // A token callback without a produced logits/argmax is a skipped + // forward (Unsupported), distinct from a wrong callback token. + Some(_) if !self.prefill_finished && self.forward_output.is_none() => { + return Err(Error::Unsupported(Stage::Executor)); + } Some(value) if !self.prefill_finished && self.forward_output == Some(value) => {} None if self.prefill_finished && self.forward_output.is_none() => {} _ => return Err(Error::IdentityMismatch),