Open-source inference server and production cluster for all the models your agent needs.
Python bgecolbertdata-pipelinedeep-learningembeddingsinferenceinference-serverinformation-retrievalllmmlmlopsnatural-language-processingnlppythonrerankingretrievalretrieval-augmented-generationsemantic-searchspladevector-search
release: v0.6.12
github-actions[bot]33e337d6c276
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 6e11a4ce0..da97be324 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,13 @@# Changelog+## v0.6.12++- chore(main): release 0.6.12+- fix(gateway): record offload before the store write (PR review)+- test(gateway): cover payload-store cleanup guard+- fix(gateway): skip payload-store cleanup DELETEs for inline requests+- fix(gliclass): guard label-window overflow + defer LEDGAR for v1.0 uni-encoders+## v0.6.11- chore(main): release 0.6.11diff --git a/deploy/helm/sie-cluster/Chart.yaml b/deploy/helm/sie-cluster/Chart.yamlindex daa243f2c..10f81d156 100644--- a/deploy/helm/sie-cluster/Chart.yaml+++ b/deploy/helm/sie-cluster/Chart.yaml@@ -4,8 +4,8 @@ description: >-SIE (Search Inference Engine) Kubernetes deployment with gateway, GPU workers,and observabilitytype: application-version: 0.6.11 # x-release-please-version-appVersion: v0.6.11 # x-release-please-version+version: 0.6.12 # x-release-please-version+appVersion: v0.6.12 # x-release-please-versionkeywords:- inference- embeddingdiff --git a/integrations/sie_chroma/pyproject.toml b/integrations/sie_chroma/pyproject.tomlindex 76be77c29..59b7a5045 100644--- a/integrations/sie_chroma/pyproject.toml+++ b/integrations/sie_chroma/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-chroma"-version = "0.6.11"+version = "0.6.12"description = "SIE integration for ChromaDB"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_crewai/pyproject.toml b/integrations/sie_crewai/pyproject.tomlindex 565022e11..2dc18eae1 100644--- a/integrations/sie_crewai/pyproject.toml+++ b/integrations/sie_crewai/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-crewai"-version = "0.6.11"+version = "0.6.12"description = "SIE integration for CrewAI"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_dspy/pyproject.toml b/integrations/sie_dspy/pyproject.tomlindex 9ecbed39e..e97c266b6 100644--- a/integrations/sie_dspy/pyproject.toml+++ b/integrations/sie_dspy/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-dspy"-version = "0.6.11"+version = "0.6.12"description = "SIE integration for DSPy"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_haystack/pyproject.toml b/integrations/sie_haystack/pyproject.tomlindex b21f01b52..6a8528cc3 100644--- a/integrations/sie_haystack/pyproject.toml+++ b/integrations/sie_haystack/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-haystack"-version = "0.6.11"+version = "0.6.12"description = "SIE integration for Haystack"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_lancedb/pyproject.toml b/integrations/sie_lancedb/pyproject.tomlindex 5d04d8609..46124894f 100644--- a/integrations/sie_lancedb/pyproject.toml+++ b/integrations/sie_lancedb/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-lancedb"-version = "0.6.11"+version = "0.6.12"description = "SIE integration for LanceDB"requires-python = ">=3.12"dependencies = [diff --git a/integrations/sie_langchain/pyproject.toml b/integrations/sie_langchain/pyproject.tomlindex 79ffb88b0..41d1398d8 100644--- a/integrations/sie_langchain/pyproject.toml+++ b/integrations/sie_langchain/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-langchain"-version = "0.6.11"+version = "0.6.12"description = "SIE integration for LangChain"requires-python = ">=3.10"dependencies = [diff --git a/integrations/sie_llamaindex/pyproject.toml b/integrations/sie_llamaindex/pyproject.tomlindex 8bd710ad9..3766358f2 100644--- a/integrations/sie_llamaindex/pyproject.toml+++ b/integrations/sie_llamaindex/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-llamaindex"-version = "0.6.11"+version = "0.6.12"description = "SIE integration for LlamaIndex"requires-python = ">=3.10"dependencies = [diff --git a/integrations/sie_qdrant/pyproject.toml b/integrations/sie_qdrant/pyproject.tomlindex 7c93998b8..423dc981c 100644--- a/integrations/sie_qdrant/pyproject.toml+++ b/integrations/sie_qdrant/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-qdrant"-version = "0.6.11"+version = "0.6.12"description = "SIE integration for Qdrant"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_ts_chroma/package.json b/integrations/sie_ts_chroma/package.jsonindex 0f69e8dae..e36987919 100644--- a/integrations/sie_ts_chroma/package.json+++ b/integrations/sie_ts_chroma/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-chroma",- "version": "0.6.11",+ "version": "0.6.12","description": "SIE embedding function for ChromaDB","type": "module","main": "./dist/index.cjs",diff --git a/integrations/sie_ts_lancedb/package.json b/integrations/sie_ts_lancedb/package.jsonindex e70d56063..140bf94f1 100644--- a/integrations/sie_ts_lancedb/package.json+++ b/integrations/sie_ts_lancedb/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-lancedb",- "version": "0.6.11",+ "version": "0.6.12","description": "SIE embedding function and reranker for LanceDB","type": "module","main": "./dist/index.cjs",diff --git a/integrations/sie_ts_langchain/package.json b/integrations/sie_ts_langchain/package.jsonindex 0814c3524..772397a57 100644--- a/integrations/sie_ts_langchain/package.json+++ b/integrations/sie_ts_langchain/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-langchain",- "version": "0.6.11",+ "version": "0.6.12","description": "SIE embeddings integration for LangChain.js","type": "module","main": "./dist/index.cjs",diff --git a/integrations/sie_ts_llamaindex/package.json b/integrations/sie_ts_llamaindex/package.jsonindex 184f9259e..153b679a7 100644--- a/integrations/sie_ts_llamaindex/package.json+++ b/integrations/sie_ts_llamaindex/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-llamaindex",- "version": "0.6.11",+ "version": "0.6.12","description": "SIE embeddings integration for LlamaIndex.TS","type": "module","main": "./dist/index.cjs",diff --git a/integrations/sie_weaviate/pyproject.toml b/integrations/sie_weaviate/pyproject.tomlindex 140520118..da62bf023 100644--- a/integrations/sie_weaviate/pyproject.toml+++ b/integrations/sie_weaviate/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-weaviate"-version = "0.6.11"+version = "0.6.12"description = "SIE integration for Weaviate"readme = "README.md"requires-python = ">=3.10"diff --git a/packages/sie_gateway/Cargo.lock b/packages/sie_gateway/Cargo.lockindex e076c539e..25c1281b5 100644--- a/packages/sie_gateway/Cargo.lock+++ b/packages/sie_gateway/Cargo.lock@@ -2960,7 +2960,7 @@ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"[[package]]name = "sie-gateway"-version = "0.6.11"+version = "0.6.12"dependencies = ["arc-swap","async-nats",diff --git a/packages/sie_gateway/Cargo.toml b/packages/sie_gateway/Cargo.tomlindex 29e2ae96e..99c830437 100644--- a/packages/sie_gateway/Cargo.toml+++ b/packages/sie_gateway/Cargo.toml@@ -1,6 +1,6 @@[package]name = "sie-gateway"-version = "0.6.11"+version = "0.6.12"edition = "2021"publish = falsediff --git a/packages/sie_gateway/openapi.json b/packages/sie_gateway/openapi.jsonindex 03dfc121c..dc0958d27 100644--- a/packages/sie_gateway/openapi.json+++ b/packages/sie_gateway/openapi.json@@ -2997,7 +2997,7 @@"url": "https://www.apache.org/licenses/LICENSE-2.0.html"},"title": "SIE Gateway",- "version": "0.6.11"+ "version": "0.6.12"},"openapi": "3.1.0","paths": {diff --git a/packages/sie_gateway/src/queue/publisher.rs b/packages/sie_gateway/src/queue/publisher.rsindex b909730c3..adc39c5a4 100644--- a/packages/sie_gateway/src/queue/publisher.rs+++ b/packages/sie_gateway/src/queue/publisher.rs@@ -636,6 +636,12 @@ pub struct WorkPublisher {/// for failure/timeout terminations, reconciled against ``pending_streams``/// by the periodic ``cleanup_expired`` sweep.offloaded_streams: DashSet<String>,+ /// Request ids that offloaded at least one ``encode``/``score`` payload to+ /// the object store (item ``{id}_{i}.bin`` or query ``{id}_score.bin``).+ /// Lets [`Self::cleanup_offloaded_payloads`] no-op for the common all-inline+ /// case, so completing a small request issues zero object-store DELETEs+ /// (issue #1471).+ offloaded_payloads: DashSet<String>,/// Core NATS client (cancel publishes use core NATS, not/// JetStream). Populated lazily by/// :meth:`start_inbox_subscription`; reads on the cancel path@@ -1219,6 +1225,7 @@ impl WorkPublisher {pending_results: DashMap::new(),pending_streams: DashMap::new(),offloaded_streams: DashSet::new(),+ offloaded_payloads: DashSet::new(),nats_client: tokio::sync::RwLock::new(None),inbox_handle: tokio::sync::Mutex::new(None),fallback_buckets: DashMap::new(),@@ -1882,6 +1889,11 @@ impl WorkPublisher {let score_payload = rmp_serde::to_vec_named(&score_payload_value).map_err(|e| format!("msgpack encode score payload: {}", e))?;let ref_key = format!("{}_score.bin", shared.request_id);+ // Track before the store write (issue #1471 review): a future dropped+ // mid-`put` may still have landed the blob, so it must stay eligible+ // for cleanup.+ self.offloaded_payloads+ .insert(shared.request_id.to_string());if let Err(e) = self.payload_store.put(&ref_key, &score_payload).await {warn!(error = %e, "failed to offload score payload, sending inline");} else {@@ -2571,6 +2583,13 @@ impl WorkPublisher {let item_msgpack = rmp_serde::to_vec_named(&item_value).map_err(|e| format!("msgpack encode offloaded item: {}", e))?;offload_key = format!("{}_{}.bin", shared.request_id, index);+ // Track the request as offloaded BEFORE the store write: this future+ // can be dropped mid-`put` when a sibling item's publish fails under+ // `try_join_all`, yet the object-store write may still have landed.+ // Recording the id first keeps the blob eligible for cleanup on the+ // error/timeout unwind (issue #1471 review).+ self.offloaded_payloads+ .insert(shared.request_id.to_string());if let Err(e) = self.payload_store.put(&offload_key, &item_msgpack).await {warn!(error = %e, "failed to offload payload, sending inline");} else {@@ -3074,20 +3093,49 @@ impl WorkPublisher {}}- /// Remove offloaded payloads for a completed/expired request.+ /// Remove offloaded payloads for a completed/expired request. No-op when the+ /// request offloaded nothing (every item was inline) — otherwise this issued+ /// an object-store DELETE per item index plus a score key on *every* request,+ /// i.e. wasted network round-trips for keys that were never written, which+ /// serialized the inbox handler and capped throughput (issue #1471).async fn cleanup_offloaded_payloads(&self, request_id: &str, total_items: u32) {- for index in 0..total_items {- let key = format!("{}_{}.bin", request_id, index);- if let Err(e) = self.payload_store.delete(&key).await {- warn!(key = %key, error = %e, "failed to remove offloaded payload");- }- }+ cleanup_offloaded_payloads_inner(+ self.payload_store.as_ref(),+ &self.offloaded_payloads,+ request_id,+ total_items,+ )+ .await;+ }+}- let score_key = format!("{}_score.bin", request_id);- if let Err(e) = self.payload_store.delete(&score_key).await {- warn!(key = %score_key, error = %e, "failed to remove offloaded score payload");+/// Delete the object-store blobs an offloaded request wrote (``{id}_{i}.bin``+/// per item + ``{id}_score.bin``) and drop its tracking entry. **No-op when the+/// request offloaded nothing** (`offloaded` does not contain it) — the common+/// all-inline case — so it issues zero object-store DELETEs. Extracted from+/// [`WorkPublisher::cleanup_offloaded_payloads`] so the guard is unit-testable+/// without a live JetStream context (issue #1471).+async fn cleanup_offloaded_payloads_inner(+ payload_store: &dyn PayloadStore,+ offloaded: &DashSet<String>,+ request_id: &str,+ total_items: u32,+) {+ if !offloaded.contains(request_id) {+ return;+ }+ for index in 0..total_items {+ let key = format!("{}_{}.bin", request_id, index);+ if let Err(e) = payload_store.delete(&key).await {+ warn!(key = %key, error = %e, "failed to remove offloaded payload");}}++ let score_key = format!("{}_score.bin", request_id);+ if let Err(e) = payload_store.delete(&score_key).await {+ warn!(key = %score_key, error = %e, "failed to remove offloaded score payload");+ }+ offloaded.remove(request_id);}/// Content negotiation: determine if client wants msgpack or JSON.@@ -3122,6 +3170,134 @@ pub fn encode_response(mod tests {use super::*;+ // --- issue #1471: payload-store cleanup guard ---+ use async_trait::async_trait;++ /// Records every `delete` so tests can assert the cleanup guard issues no+ /// object-store DELETEs for inline (non-offloaded) requests.+ #[derive(Default)]+ struct CountingPayloadStore {+ deleted: std::sync::Mutex<Vec<String>>,+ fail_delete: bool,+ }++ #[async_trait]+ impl PayloadStore for CountingPayloadStore {+ async fn put(&self, _key: &str, _data: &[u8]) -> Result<String, String> {+ Ok(String::new())+ }+ async fn delete(&self, key: &str) -> Result<(), String> {+ self.deleted.lock().unwrap().push(key.to_string());+ if self.fail_delete {+ Err("simulated object-store delete failure".to_string())+ } else {+ Ok(())+ }+ }+ }++ // Common case (issue #1471): a small/inline request that never offloaded a+ // payload must issue ZERO object-store DELETEs — the unconditional+ // per-request DELETE storm is exactly what capped throughput.+ #[tokio::test]+ async fn cleanup_offloaded_payloads_noop_when_nothing_offloaded() {+ let store = CountingPayloadStore::default();+ let offloaded: DashSet<String> = DashSet::new(); // request NOT tracked+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-inline", 4).await;+ let deleted = store.deleted.lock().unwrap();+ assert!(+ deleted.is_empty(),+ "inline request must not trigger payload-store deletes, got {:?}",+ *deleted,+ );+ }++ // A request that actually offloaded gets its blobs deleted (one per item+ // index + the score key) and is dropped from the tracking set.+ #[tokio::test]+ async fn cleanup_offloaded_payloads_deletes_when_offloaded() {+ let store = CountingPayloadStore::default();+ let offloaded: DashSet<String> = DashSet::new();+ offloaded.insert("req-big".to_string());+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-big", 2).await;+ let mut got = store.deleted.lock().unwrap().clone();+ got.sort();+ assert_eq!(+ got,+ vec![+ "req-big_0.bin".to_string(),+ "req-big_1.bin".to_string(),+ "req-big_score.bin".to_string(),+ ],+ "offloaded request must delete each item blob + the score key",+ );+ assert!(+ !offloaded.contains("req-big"),+ "tracking entry must be dropped after cleanup",+ );+ }++ // A tracked request with zero items deletes ONLY the score key (no item+ // blobs): pins the loop bound + the always-issued score delete.+ #[tokio::test]+ async fn cleanup_offloaded_payloads_total_items_zero_deletes_only_score() {+ let store = CountingPayloadStore::default();+ let offloaded: DashSet<String> = DashSet::new();+ offloaded.insert("req-score".to_string());+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-score", 0).await;+ let got = store.deleted.lock().unwrap().clone();+ assert_eq!(+ got,+ vec!["req-score_score.bin".to_string()],+ "total_items=0 must delete only the score key, no item blobs",+ );+ assert!(!offloaded.contains("req-score"));+ }++ // Cleanup is idempotent: a second call (both terminal cleanup paths can+ // fire) is a no-op once the first dropped the tracking entry.+ #[tokio::test]+ async fn cleanup_offloaded_payloads_second_call_is_noop() {+ let store = CountingPayloadStore::default();+ let offloaded: DashSet<String> = DashSet::new();+ offloaded.insert("req-twice".to_string());+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-twice", 1).await;+ let after_first = store.deleted.lock().unwrap().len();+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-twice", 1).await;+ let after_second = store.deleted.lock().unwrap().len();+ assert_eq!(+ after_first, after_second,+ "second cleanup must issue no further deletes (entry already removed)",+ );+ }++ // A failing object store must not break cleanup: every delete is still+ // attempted (errors are logged best-effort). NOTE: a transient delete+ // failure currently drops the tracking entry without retry, so the blob+ // leaks — retain-on-failure + a reconcile sweep (mirroring+ // cleanup_offloaded_generate) is the #1471 follow-up.+ #[tokio::test]+ async fn cleanup_offloaded_payloads_best_effort_on_delete_failure() {+ let store = CountingPayloadStore {+ fail_delete: true,+ ..Default::default()+ };+ let offloaded: DashSet<String> = DashSet::new();+ offloaded.insert("req-fail".to_string());+ cleanup_offloaded_payloads_inner(&store, &offloaded, "req-fail", 2).await;+ let mut attempted = store.deleted.lock().unwrap().clone();+ attempted.sort();+ assert_eq!(+ attempted,+ vec![+ "req-fail_0.bin".to_string(),+ "req-fail_1.bin".to_string(),+ "req-fail_score.bin".to_string(),+ ],+ "all deletes must be attempted even when the store errors",+ );+ }+#[derive(Debug, Clone, Serialize, Deserialize)]struct WorkItem {pub work_item_id: String,diff --git a/packages/sie_sdk/pyproject.toml b/packages/sie_sdk/pyproject.tomlindex b235315af..eded1bcb1 100644--- a/packages/sie_sdk/pyproject.toml+++ b/packages/sie_sdk/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-sdk"-version = "0.6.11"+version = "0.6.12"description = "Search Inference Engine - Python SDK"requires-python = ">=3.12"license = { text = "Apache-2.0" }diff --git a/packages/sie_server/openapi.json b/packages/sie_server/openapi.jsonindex b48e8e231..fff6f38e5 100644--- a/packages/sie_server/openapi.json+++ b/packages/sie_server/openapi.json@@ -3,7 +3,7 @@"info": {"title": "SIE Server","description": "Search Inference Engine - GPU inference server for search workloads",- "version": "0.6.11"+ "version": "0.6.12"},"paths": {"/": {diff --git a/packages/sie_server/pyproject.toml b/packages/sie_server/pyproject.tomlindex 936867460..f2ed1f6fb 100644--- a/packages/sie_server/pyproject.toml+++ b/packages/sie_server/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-server"-version = "0.6.11"+version = "0.6.12"description = "Search Inference Engine - GPU inference server for search workloads"requires-python = ">=3.12,<3.13"license = { text = "Apache-2.0" }diff --git a/packages/sie_server/src/sie_server/adapters/gliclass/__init__.py b/packages/sie_server/src/sie_server/adapters/gliclass/__init__.pyindex b2f8fc561..dda87093d 100644--- a/packages/sie_server/src/sie_server/adapters/gliclass/__init__.py+++ b/packages/sie_server/src/sie_server/adapters/gliclass/__init__.py@@ -35,15 +35,17 @@ if TYPE_CHECKING:_ERR_REQUIRES_LABELS = "Zero-shot classification requires labels parameter."_ERR_INPUT_TOO_LONG = (- "Input produced an empty tensor inside the gliclass pipeline; "- "this typically indicates the input exceeds the model's max sequence length "- "even after truncation. Reduce input length or split into chunks."+ "Input overflowed the gliclass model's max sequence length (the label/text "+ "window could not fit after truncation). Reduce the number of labels or the "+ "input length, or split into chunks.")-# Matches the torch IndexError shape "index N is out of bounds for dimension D-# with size 0" emitted when gliclass indexes into an empty post-processing-# tensor on overflowing inputs. ``\b`` anchors the size to a word boundary so a-# hypothetical "with size 02" cannot falsely match.-_INDEX_OOB_EMPTY_TENSOR_RE = re.compile(r"out of bounds for dimension \d+ with size 0\b")+# Captures the index and size from the torch IndexError shape "index N is out of+# bounds for dimension D with size M". The dispatch below only treats it as an+# overflow when N == M (the off-by-one / exhausted-dimension shape); a generic+# out-of-range bug (N > M) keeps propagating. Anchored to the "out of bounds for+# dimension" shape so an unrelated IndexError such as "list index out of range"+# never matches at all.+_INDEX_OOB_RE = re.compile(r"index (\d+) is out of bounds for dimension \d+ with size (\d+)")ClassificationType = Literal["single-label", "multi-label"]@@ -294,12 +296,25 @@ class GLiClassAdapter(BaseAdapter):# unrelated errors. Catalog of caught signatures:# - RuntimeError "argmax(): ... numel() == 0" (sie-test#89 / #848)# torch.argmax on an empty tensor inside the classification head.- # - IndexError "index N is out of bounds for dimension D with size 0" (#860)- # indexing an empty tensor in the gliclass post-processing path.+ # - IndexError "index N is out of bounds for dimension D with size N"+ # (index == size: off-by-one / exhausted dimension). Covers both the+ # empty-tensor case (#860, index 0 / size 0) and the label-window+ # overflow (#1434, e.g. index 79 / size 79): when too many labels+ # overflow the shared 512-token window only some survive truncation+ # and the single-label hierarchical decode then indexes exactly one+ # past the shrunk label window.msg = str(exc)if isinstance(exc, RuntimeError) and "numel() == 0" in msg and "argmax" in msg:raise InputTooLongError(_ERR_INPUT_TOO_LONG) from exc- if isinstance(exc, IndexError) and _INDEX_OOB_EMPTY_TENSOR_RE.search(msg):+ oob = _INDEX_OOB_RE.search(msg)+ if isinstance(exc, IndexError) and oob is not None and oob.group(1) == oob.group(2):+ # Off-by-one: the gliclass single-label hierarchical decode indexes+ # exactly one past an exhausted dimension (index == size) when the+ # label/text window overflows max_sequence_length. Covers both the+ # empty-tensor case (#860, index 0 / size 0) and the label-window+ # overflow (#1434, e.g. index 79 / size 79). A generic out-of-range+ # bug (index > size, e.g. index 5 / size 3) is NOT this and must keep+ # propagating via the bare ``raise`` below.raise InputTooLongError(_ERR_INPUT_TOO_LONG) from excraisediff --git a/packages/sie_server/tests/adapters/test_gliclass_overflow_policy.py b/packages/sie_server/tests/adapters/test_gliclass_overflow_policy.pyindex a8e5e14b9..281b96cce 100644--- a/packages/sie_server/tests/adapters/test_gliclass_overflow_policy.py+++ b/packages/sie_server/tests/adapters/test_gliclass_overflow_policy.py@@ -1,5 +1,7 @@from __future__ import annotations+from types import SimpleNamespace+import pytestfrom sie_server.adapters.errors import InputTooLongErrorfrom sie_server.adapters.gliclass import GLiClassAdapter@@ -100,3 +102,80 @@ class TestApplyOverflowPolicy:texts = ["a b c"]assert adapter._apply_overflow_policy(texts, _LABELS, "default") == texts+++class _RaisingPipeline:+ """Fake gliclass pipeline whose __call__ raises a chosen exception.++ Exercises the except-block crash-signature mapping in+ ``GLiClassAdapter.extract`` end-to-end (not just ``_apply_overflow_policy``).+ The default overflow policy returns texts without touching ``.pipe``, so the+ pipeline only needs to be callable.+ """++ def __init__(self, exc: BaseException) -> None:+ self._exc = exc++ def __call__(self, *args: object, **kwargs: object) -> object:+ raise self._exc+++def _make_raising_adapter(exc: BaseException) -> GLiClassAdapter:+ adapter = GLiClassAdapter("test-model")+ adapter._pipeline = _RaisingPipeline(exc) # ty:ignore[invalid-assignment]+ return adapter+++class TestExtractOverflowGuard:+ """The ``extract`` except block maps known crash signatures to+ ``InputTooLongError`` and lets unrelated errors propagate unchanged.+ """++ def test_label_window_off_by_one_maps_to_input_too_long(self) -> None:+ # The new #1434 case: too many labels overflow the shared window, only+ # ~79 of 100 survive, and the single-label decode indexes past the+ # shrunk window (size > 0).+ adapter = _make_raising_adapter(IndexError("index 79 is out of bounds for dimension 0 with size 79"))+ items = [SimpleNamespace(text="hello world")]++ with pytest.raises(InputTooLongError):+ adapter.extract(items, labels=_LABELS) # ty:ignore[invalid-argument-type]++ def test_empty_tensor_index_maps_to_input_too_long(self) -> None:+ adapter = _make_raising_adapter(IndexError("index 0 is out of bounds for dimension 0 with size 0"))+ items = [SimpleNamespace(text="hello world")]++ with pytest.raises(InputTooLongError):+ adapter.extract(items, labels=_LABELS) # ty:ignore[invalid-argument-type]++ def test_argmax_empty_tensor_maps_to_input_too_long(self) -> None:+ adapter = _make_raising_adapter(+ RuntimeError("argmax(): Expected reduction dim to be specified for input.numel() == 0.")+ )+ items = [SimpleNamespace(text="hello world")]++ with pytest.raises(InputTooLongError):+ adapter.extract(items, labels=_LABELS) # ty:ignore[invalid-argument-type]++ def test_unrelated_index_error_propagates(self) -> None:+ adapter = _make_raising_adapter(IndexError("list index out of range"))+ items = [SimpleNamespace(text="hello world")]++ with pytest.raises(IndexError, match="list index out of range"):+ adapter.extract(items, labels=_LABELS) # ty:ignore[invalid-argument-type]++ def test_generic_out_of_range_index_error_propagates(self) -> None:+ # index > size: a genuine out-of-range bug against a non-empty tensor,+ # NOT the #1434 off-by-one (index == size), so it must propagate.+ adapter = _make_raising_adapter(IndexError("index 5 is out of bounds for dimension 0 with size 3"))+ items = [SimpleNamespace(text="hello world")]++ with pytest.raises(IndexError, match="size 3"):+ adapter.extract(items, labels=_LABELS) # ty:ignore[invalid-argument-type]++ def test_unrelated_runtime_error_propagates(self) -> None:+ adapter = _make_raising_adapter(RuntimeError("CUDA out of memory"))+ items = [SimpleNamespace(text="hello world")]++ with pytest.raises(RuntimeError, match="CUDA out of memory"):+ adapter.extract(items, labels=_LABELS) # ty:ignore[invalid-argument-type]diff --git a/packages/sie_server/tests/adapters/test_runtime_options.py b/packages/sie_server/tests/adapters/test_runtime_options.pyindex 93b08597f..12b4f185b 100644--- a/packages/sie_server/tests/adapters/test_runtime_options.py+++ b/packages/sie_server/tests/adapters/test_runtime_options.py@@ -929,7 +929,7 @@ class TestExtractRuntimeOptions:adapter._pipeline = mock_pipelineadapter._device = "cpu"- with pytest.raises(ValueError, match="empty tensor"):+ with pytest.raises(ValueError, match="max sequence length"):adapter.extract([Item(text="x" * 6000)], labels=["Electronics"])def test_gliclass_translates_index_oob_crash_to_validation_error(self) -> None:@@ -950,7 +950,7 @@ class TestExtractRuntimeOptions:adapter._pipeline = mock_pipelineadapter._device = "cpu"- with pytest.raises(ValueError, match="empty tensor"):+ with pytest.raises(ValueError, match="max sequence length"):adapter.extract([Item(text="x" * 6000)], labels=["Electronics"])def test_gliclass_unrelated_runtime_error_propagates(self) -> None:@@ -976,15 +976,38 @@ class TestExtractRuntimeOptions:with pytest.raises(RuntimeError, match="argmax"):adapter.extract([Item(text="hello")], labels=["a", "b"])- # Also: an IndexError with "out of bounds" but NOT "size 0" must propagate- # (e.g. a real out-of-range index against a non-empty tensor).+ # Also: an IndexError of the "index N out of bounds for dimension D with+ # size N" shape where index == size is the #1434 label-window off-by-one+ # and IS mapped to validation (InputTooLongError), not propagated, because+ # too many labels overflowed the shared window and the single-label decode+ # indexed exactly one past the shrunk label window.+ mock_pipeline.side_effect = IndexError("index 79 is out of bounds for dimension 0 with size 79")+ with pytest.raises(ValueError, match="max sequence length"):+ adapter.extract([Item(text="hello")], labels=["a", "b"])++ # Also: the empty-tensor case (index 0 / size 0, #860) is the same+ # exhausted-dimension shape (index == size) and is mapped to validation.+ mock_pipeline.side_effect = IndexError("index 0 is out of bounds for dimension 0 with size 0")+ with pytest.raises(ValueError, match="max sequence length"):+ adapter.extract([Item(text="hello")], labels=["a", "b"])++ # Also: an IndexError with "out of bounds" but index > size (NOT the+ # off-by-one shape) is a genuine out-of-range bug and must propagate —+ # e.g. a real out-of-range index against a non-empty tensor.mock_pipeline.side_effect = IndexError("index 5 is out of bounds for dimension 0 with size 3")with pytest.raises(IndexError, match="size 3"):adapter.extract([Item(text="hello")], labels=["a", "b"])- # Also: an IndexError mentioning "size 0" but NOT "out of bounds for- # dimension ... with size 0" must propagate — locks in the full- # "out of bounds for dimension D with size 0" discriminator.+ # Also: a genuinely-unrelated IndexError NOT matching the "out of bounds+ # for dimension" shape (e.g. "list index out of range") must propagate —+ # locks in that the guard stays anchored to the torch-tensor shape.+ mock_pipeline.side_effect = IndexError("list index out of range")+ with pytest.raises(IndexError, match="list index out of range"):+ adapter.extract([Item(text="hello")], labels=["a", "b"])++ # Also: an IndexError mentioning "size 0" but NOT the full "index N is out+ # of bounds for dimension D with size M" shape must propagate — locks in+ # that the guard is anchored to the torch-tensor index/size shape.mock_pipeline.side_effect = IndexError("some unrelated error with size 0 buried in the message")with pytest.raises(IndexError, match="unrelated"):adapter.extract([Item(text="hello")], labels=["a", "b"])diff --git a/packages/sie_server_sidecar/Cargo.lock b/packages/sie_server_sidecar/Cargo.lockindex a93b21a81..a172f3a94 100644--- a/packages/sie_server_sidecar/Cargo.lock+++ b/packages/sie_server_sidecar/Cargo.lock@@ -2208,7 +2208,7 @@ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"[[package]]name = "sie-server-sidecar"-version = "0.6.11"+version = "0.6.12"dependencies = ["anyhow","async-nats",diff --git a/packages/sie_server_sidecar/Cargo.toml b/packages/sie_server_sidecar/Cargo.tomlindex 03ad25d01..4b3b92776 100644--- a/packages/sie_server_sidecar/Cargo.toml+++ b/packages/sie_server_sidecar/Cargo.toml@@ -1,6 +1,6 @@[package]name = "sie-server-sidecar"-version = "0.6.11"+version = "0.6.12"edition = "2021"description = "SIE worker sidecar: NATS JetStream consumer, scheduler, IPC client, and GPU-independent prep for sie-server pods."diff --git a/packages/sie_ts_sdk/package.json b/packages/sie_ts_sdk/package.jsonindex 706f1addb..524b974fe 100644--- a/packages/sie_ts_sdk/package.json+++ b/packages/sie_ts_sdk/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-sdk",- "version": "0.6.11",+ "version": "0.6.12","description": "Official TypeScript SDK for SIE (Search Inference Engine)","type": "module","main": "./dist/index.cjs",diff --git a/packages/sie_ts_sdk/src/version.ts b/packages/sie_ts_sdk/src/version.tsindex ed483dd62..71a185022 100644--- a/packages/sie_ts_sdk/src/version.ts+++ b/packages/sie_ts_sdk/src/version.ts@@ -1 +1 @@-export const SDK_VERSION = "0.6.11"; // x-release-please-version+export const SDK_VERSION = "0.6.12"; // x-release-please-versiondiff --git a/uv.lock b/uv.lockindex 6b34e8d7f..c05628ee0 100644--- a/uv.lock+++ b/uv.lock@@ -5719,7 +5719,7 @@ dev = [[[package]]name = "sie-admin"-version = "0.6.11"+version = "0.6.12"source = { editable = "packages/sie_admin" }dependencies = [{ name = "httpx" },@@ -5752,7 +5752,7 @@ requires-dist = [[[package]]name = "sie-bench"-version = "0.6.11"+version = "0.6.12"source = { editable = "packages/sie_bench" }dependencies = [{ name = "aiohttp" },@@ -5837,7 +5837,7 @@ requires-dist = [[[package]]name = "sie-chroma"-version = "0.6.11"+version = "0.6.12"source = { editable = "integrations/sie_chroma" }dependencies = [{ name = "chromadb" },@@ -5909,7 +5909,7 @@ dev = [[[package]]name = "sie-crewai"-version = "0.6.11"+version = "0.6.12"source = { editable = "integrations/sie_crewai" }dependencies = [{ name = "crewai" },@@ -5934,7 +5934,7 @@ requires-dist = [[[package]]name = "sie-dspy"-version = "0.6.11"+version = "0.6.12"source = { editable = "integrations/sie_dspy" }dependencies = [{ name = "dspy" },@@ -5959,7 +5959,7 @@ requires-dist = [[[package]]name = "sie-haystack"-version = "0.6.11"+version = "0.6.12"source = { editable = "integrations/sie_haystack" }dependencies = [{ name = "haystack-ai" },@@ -5986,7 +5986,7 @@ requires-dist = [[[package]]name = "sie-lancedb"-version = "0.6.11"+version = "0.6.12"source = { editable = "integrations/sie_lancedb" }dependencies = [{ name = "lancedb" },@@ -6013,7 +6013,7 @@ requires-dist = [[[package]]name = "sie-langchain"-version = "0.6.11"+version = "0.6.12"source = { editable = "integrations/sie_langchain" }dependencies = [{ name = "langchain-core" },@@ -6040,7 +6040,7 @@ requires-dist = [[[package]]name = "sie-llamaindex"-version = "0.6.11"+version = "0.6.12"source = { editable = "integrations/sie_llamaindex" }dependencies = [{ name = "llama-index-core" },@@ -6106,7 +6106,7 @@ dev = [[[package]]name = "sie-qdrant"-version = "0.6.11"+version = "0.6.12"source = { editable = "integrations/sie_qdrant" }dependencies = [{ name = "qdrant-client" },@@ -6129,7 +6129,7 @@ requires-dist = [[[package]]name = "sie-sdk"-version = "0.6.11"+version = "0.6.12"source = { editable = "packages/sie_sdk" }dependencies = [{ name = "aiohttp" },@@ -6182,7 +6182,7 @@ requires-dist = [[[package]]name = "sie-server"-version = "0.6.11"+version = "0.6.12"source = { editable = "packages/sie_server" }dependencies = [{ name = "blake3" },@@ -6312,7 +6312,7 @@ requires-dist = [[[package]]name = "sie-weaviate"-version = "0.6.11"+version = "0.6.12"source = { editable = "integrations/sie_weaviate" }dependencies = [{ name = "sie-sdk" },