DocxReader and PPTXReader read FastAPI uploads, plus read_file and C# fixes
November 17, 20261 min read
Agno's DocxReader and PPTXReader now return the text of Word and PowerPoint files uploaded through FastAPI. This release also fixes read_file in FileTools and Workspace, and C# headings in PageMarkdownChunking. We ran each fix on this release and the previous one with real files and no model.
Word and PowerPoint uploads keep their content
A Word file uploaded through FastAPI reaches your code as a SpooledTemporaryFile, and DocxReader handed back an empty list for it. Python's temporary streams report a name of None or an integer, and the reader called .split() on that name after parsing the file, so the reader logged the error and dropped the content. DocxReader and PPTXReader now fall back to the names docx_file and pptx_file when a stream has no string name, in read and async_read alike, and a name you pass still wins.
# real output, files built with python-docx and python-pptx, read from a SpooledTemporaryFile
DocxReader(chunk=False).read(stream)
Before [] ERROR Error reading file: 'NoneType' object has no attribute 'split'
Now [('docx_file', 'Quarterly report: revenue up 12%')]
PPTXReader(chunk=False).read(stream)
Before []
Now [('pptx_file', 'Slide 1:\nQuarterly report: revenue up 12%')]See the cookbook, and learn more about readers in the documentation.
read_file returns a file at its line limit
An agent with max_file_lines=5 could not read a five-line file, because the file ended in a newline. FileTools.read_file and Workspace.read_file both counted the empty piece after that final newline as one more line. Both now treat a trailing line separator as the end of the last line, and Workspace reports the file's real count when it refuses a longer one.
# real output, notes.txt holds five lines and a trailing newline
FileTools(max_file_lines=5).read_file("notes.txt")
Before Error reading file: file too long. Use read_file_chunk instead
Now 'one\ntwo\nthree\nfour\nfive\n'See the cookbook, and learn more about FileTools and Workspace in the documentation.
C# headings keep their hash
A docs page titled # C# came out of PageMarkdownChunking with the breadcrumb C, and its ## Using F# section became C › Using F. The heading pattern read any trailing # as a closing sequence. PageMarkdownChunking now treats trailing hashes as closing only after a space or tab, following CommonMark's rule for ATX headings, so C#, F# and C## survive in the breadcrumb and in the context line that opens every chunk.
# real output, PageMarkdownChunking().chunk() on "# C#" with a "## Using F#" section
Before breadcrumbs ['C', 'C › Using F'], context line 'C: Language guide.'
Now breadcrumbs ['C#', 'C# › Using F#'], context line 'C#: Language guide.'See the cookbook, and learn more about published pages in the documentation.
Frequently asked questions
On macOS and Linux a TemporaryFile reports its file descriptor as its name, an integer such as 3. Earlier releases parsed the file, then failed on that integer with 'int' object has no attribute 'split' and returned an empty list. This release names the document docx_file, or pptx_file for PPTXReader.
No. A file whose last line has no newline was always counted correctly. Only the empty piece after a final line separator pushed the count one over, and FileTools applies the same rule to a custom line_separator such as "||".
A six-line file with max_file_lines=5 now returns Error: file too long (6 lines > 5). Use start_line/end_line to read a chunk, or use search_content to find specific text first. Earlier releases said 7 lines for the same file.
A closing sequence that follows a space or tab, as in # C# ###, which becomes C#. Fumadocs anchor suffixes such as [#c-sharp] are also stripped from breadcrumbs, and every chunk body keeps the heading exactly as written.



