mirror of
https://github.com/open-webui/open-terminal.git
synced 2026-11-05 01:27:28 +00:00
[PR #114] Feature: Use document extractors for grep and centralize file text extraction #125
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/open-terminal#125
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-terminal/pull/114
Author: @pfurovYnP
Created: 4/21/2026
Status: 🔄 Open
Base:
main← Head:main📝 Commits (5)
c6f860bRefactor shared document extraction logic for read and grepbcb7593Merge pull request #1 from pfurovYnP/codex/update-grep-to-use-text-representationsc1b3ffaupdate doc for grepb0812cfAvoid executor starvation for PTY readsf5e5bc8Merge pull request #3 from pfurovYnP/codex/investigate-asynchronous-operations-for-terminal📊 Changes
3 files changed (+177 additions, -53 deletions)
View changed files
📝
open_terminal/main.py(+91 -48)📝
open_terminal/utils/runner.py(+48 -5)➕
tests/test_runner.py(+38 -0)📄 Description
(Codex)
#113
Motivation
read_fileis also applied when searching files withgrep_searchso searchable content from PDFs/Office files is included.Description
_extract_text_with_supported_document_extractors(file_path, mime)to encapsulate lookup and invocation ofEXTRACTORSfromopen_terminal.utils.documentsand return extracted text orNone._read_file_as_text_representation_for_grep(file_path)which mirrorsread_filebehavior: attempt UTF-8 read first, fall back to the document extractors, and raiseUnicodeDecodeErrorfor unsupported binary files.read_fileto call the new extractor helper and simplified the previous inline extractor loop.grep_searchto use_read_file_as_text_representation_for_grepso document-extracted text is searched line-by-line, preserving existing match and truncation behaviour.Testing
pytest, and all tests completed successfully.read_fileandgrep_searchbehavior manually against text files and PDF/Office files to verify extracted text is returned and searchable as expected.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.