Bug Report: read_file 读 PDF 不加 pages 参数导致 channel close
Description
用 read_file 读取 PDF 文件时,如果不指定 pages 参数(全量提取),工具调用会挂起无响应。按 ESC 中断后显示 Error: channel closed。但指定 pages 按页读取完全正常。
测试文件:教务系统导出的成绩单 PDF,60~80KB,仅 2 页,非扫描件(纯文本 PDF)。
Steps to reproduce
- 准备一个教务系统导出的 PDF(如附件的成绩单 PDF)
- 在 codewhale-tui 中执行:
read_file("xxx.pdf", pages: "1") → 正常返回文本
- 执行:
read_file("xxx.pdf") 不加 pages 参数 → 挂起无响应
- 按 ESC →
Error: channel closed
Expected behavior
不加 pages 参数时正常提取全部页面文本,行为应与 pages: "1-N" 一致。
Actual behavior
工具调用挂起,通信 channel 断开。
Impact
每次读 PDF 必须手动指定 pages 范围。如果不知道 PDF 页数,需要先试探页数,体验较差。这个问题 100% 可复现于该测试文件。
Environment
- OS: Windows(传统控制台主机,非 Windows Terminal)
- codewhale version: 0.8.49 (492f20d)
- Install method: release binary (codewhale-tui.exe)
codewhale doctor summary:
- pdftotext: not found(使用内置纯 Rust 提取器)
- tesseract: not found(无 OCR)
- sandbox: not available
- Model/provider: deepseek-v4-pro / DeepSeek
- Terminal app: Windows Console Host(legacy)
- Shell: PowerShell
Logs, screenshots, or recordings
pages: "1" 正常返回
pages: "2" 正常返回
- 不加
pages → 挂起 → ESC → Error: channel closed
- 文件仅 60~80KB、2 页,排除文件过大或 OCR 慢的可能
- 怀疑纯 Rust PDF 提取器在全量提取模式下,对某些 PDF 交叉引用表/字体编码存在死循环
Bug Report:
read_file读 PDF 不加pages参数导致 channel closeDescription
用
read_file读取 PDF 文件时,如果不指定pages参数(全量提取),工具调用会挂起无响应。按 ESC 中断后显示Error: channel closed。但指定pages按页读取完全正常。测试文件:教务系统导出的成绩单 PDF,60~80KB,仅 2 页,非扫描件(纯文本 PDF)。
Steps to reproduce
read_file("xxx.pdf", pages: "1")→ 正常返回文本read_file("xxx.pdf")不加pages参数 → 挂起无响应Error: channel closedExpected behavior
不加
pages参数时正常提取全部页面文本,行为应与pages: "1-N"一致。Actual behavior
工具调用挂起,通信 channel 断开。
Impact
每次读 PDF 必须手动指定
pages范围。如果不知道 PDF 页数,需要先试探页数,体验较差。这个问题 100% 可复现于该测试文件。Environment
codewhale doctorsummary:Logs, screenshots, or recordings
pages: "1"正常返回pages: "2"正常返回pages→ 挂起 → ESC →Error: channel closed