fix(P2-1): [FILE]-Block-Stripping nach fehlgeschlagenen Downloads in _download_and_inline_files
- Non-greedy Regex entfernt alle übrigen [FILE]...Download:... Blöcke nach der Download-Schleife - Verhindert dass der Agent Download-URLs sieht wenn Downloads fehlschlagen - 3 neue Tests: TestFileBlockStripping (fail-only, mixed success/fail, unicode filenames)
This commit is contained in:
@@ -6006,6 +6006,12 @@ class RocketChatAdapter(BasePlatformAdapter):
|
||||
block = f"\n\n[FILE CONTENT: {fname}]\n{content[:10000]}\n[/FILE]"
|
||||
text += block
|
||||
logger.debug("[rocketchat] Inlined file %s (%d chars)", fname, len(block))
|
||||
# P2-1: Alle übrigen [FILE]-Blöcke entfernen (fehlgeschlagene Downloads)
|
||||
# Non-greedy Pattern: erfasst [FILE]...Download:... bis zum nächsten \n
|
||||
# re.DOTALL damit Zeilenumbrüche innerhalb des Blocks matchen
|
||||
text = re.sub(
|
||||
r'\[FILE\].*?Download:[^\n]+\n?', '', text, flags=re.DOTALL
|
||||
)
|
||||
return text
|
||||
|
||||
async def disconnect(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user