mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[GH-ISSUE #17176] issue: unnecessary package includes when running with pydiode #56861
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rbx on GitHub (Sep 3, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/17176
Check Existing Issues
Installation Method
Pip Install
Open WebUI Version
v0.6.26
Ollama Version (if applicable)
0.11.7
Operating System
Fedora 42
Browser (if applicable)
Firefox
Confirmation
README.md.Expected Behavior
Only packages needed by the code should be imported by pydiode.
Actual Behavior
When using Code Execution with pydiode, sometimes unnecessary packages are included. For example here regex produces some debug output, although it shouldn't be included at all based on the provided code:
Steps to Reproduce
Try the prompt+result provided in the screenshot.
Logs & Screenshots
browser:
Additional Information
Digging into the code base a little bit, this seems to be the culprit: https://github.com/open-webui/open-webui/blob/main/src/lib/components/chat/Messages/CodeBlock.svelte#L225
Which seems to search the entire code for those patterns.
Would it be better to search only for import statements (thus requiring those to be present)?
I tried the following modification and it resolves the issue:
@tjbck commented on GitHub (Sep 3, 2025):
Good catch, addressed with bbe116795860a81a647d9567e0d9cb1950650095!