Add missing file detection keywords for REPL mode#60
Merged
Conversation
Added missing file-writing keywords to the REPL mode file detection list. Previously, files created with pandas to_excel() and other export methods were not captured because the keyword list only included: open(), savefig, to_csv, write(), .save(). Added: to_excel, to_json, to_parquet, to_html, to_xml, to_feather, to_pickle, dump() (for json.dump, pickle.dump, yaml.dump). This fix ensures generated files are properly detected and returned in the API response when using REPL mode (Python only).
Fix REPL file detection for pandas export methods
usnavy13
previously approved these changes
Mar 3, 2026
Owner
usnavy13
left a comment
There was a problem hiding this comment.
Looks good. Clean, minimal bug fix — extends the REPL file detection keyword list with missing pandas export methods and dump(). No correctness or security concerns; false positives only trigger an extra file scan (~1s), not incorrect behavior.
djuillard
pushed a commit
to On-Behalf-AI/LibreCodeInterpreter
that referenced
this pull request
Apr 21, 2026
Add missing file detection keywords for REPL mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Body:
Description
When Python REPL mode is enabled, files generated with
to_excel()and other pandas export methods are not captured in the API response. Thefilesarray comes back empty even though the file is successfully created in/mnt/data/.This is because the keyword list in
src/services/execution/runner.pythat triggers file detection in REPL mode is missing several common file-writing methods.This change extends the keyword list to include:
to_excel,to_json,to_parquet,to_html,to_xml,to_feather,to_pickle, anddump()(forjson.dump,pickle.dump,yaml.dumppatterns).Fixes #59
Type of change
How Has This Been Tested?
Tested by executing Python code via the
/execendpoint with REPL mode enabled:to_excel()— previously returned emptyfilesarray, now correctly captures the.xlsxfileto_csv()— confirmed still working (was already in the keyword list)open()/write()— confirmed still workingTest configuration:
Checklist: