From 4331ee422f439efb4e7c57b69a6359348c53a90e Mon Sep 17 00:00:00 2001 From: Arash <2973722+arash77@users.noreply.github.com> Date: Tue, 1 Sep 2026 10:31:40 +0200 Subject: [PATCH] langchain_text_splitters: stop before Galaxy's dataset limit and fix two misleading warnings - fail early when the settings would produce more chunks than the instance's max_discovered_files, instead of splitting everything and then letting Galaxy fail the job on the file count - name the cause that fits the run in the altered-text warning instead of always blaming multi-byte tokens - stop reporting a null start index for overlapping chunks that legitimately begin at the same offset - set strip_whitespace once for every splitter instead of per branch - correct the help on whitespace at a chunk boundary, and let three tests assert the warning instead of pinning the upstream -1 --- .../langchain_text_splitters.xml | 36 +++++--- tools/langchain_text_splitters/split_text.py | 91 ++++++++++++++----- 2 files changed, 94 insertions(+), 33 deletions(-) diff --git a/tools/langchain_text_splitters/langchain_text_splitters.xml b/tools/langchain_text_splitters/langchain_text_splitters.xml index 0d5f76a752..21d09a43d5 100644 --- a/tools/langchain_text_splitters/langchain_text_splitters.xml +++ b/tools/langchain_text_splitters/langchain_text_splitters.xml @@ -26,6 +26,9 @@ --chunks-dir chunks --chunk-size '$chunk_size' --chunk-overlap '$chunk_overlap' + ## The instance's own ceiling on datasets discovered per job, so the tool + ## stops early instead of being failed by Galaxy after all the work. + --max-chunk-files '$__app__.config.max_discovered_files' #if $splitter.method == "character" #if $splitter.character_splitter.type == "recursive" --splitter-type recursive_character @@ -44,7 +47,7 @@ #if $splitter.character_splitter.type == "recursive" #if $splitter.character_splitter.separator_settings.mode == "custom" --separator-specs - #for $separator in $splitter.character_splitter.separator_settings.separators + #for $separator in $splitter.character_splitter.separator_settings.separators #if $separator.separator_definition.sep_opt == "custom" 'custom:$separator.separator_definition.value' #else @@ -88,7 +91,7 @@ -