getMessages on a large session kills the stdio transport (write EINVAL) and the CLI hangs
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend, cli, networking
Hướng nghiên cứu
Start by tracing the Rust JSON-RPC stdio transport path used by session.get_events() and how it writes large responses; the issue names no source files or tests. Reproduce with a large events.jsonl and compare the response size with the reported write EINVAL failure. Done means the request returns or reports an error while the transport remains usable, or the CLI closes stdout so the client detects disconnection.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
I'm driving the CLI from the Python SDK over stdio. One of my sessions got really big (events.jsonl is ~808 MB, lots of screenshots in it). If I resume it and call session.get_events(), about 6 seconds later the CLI log shows:
[ERROR] Rust JSON-RPC transport error: Error: write EINVAL
After that the CLI never writes anything to stdout again. The getMessages call never comes back, ping / status.get time out, but the process is still alive, so the SDK has no idea the connection is gone. client.stop() hangs too, and the process ignored SIGTERM, so I had to kill -9 it.
Smaller sessions are fine. I truncated the same events.jsonl to check:
- 100 MB: getMessages returns in ~2s
- 300 MB: ~4s
- 808 MB: write EINVAL, connection dead
Resuming the 808 MB session without calling getMessages works fine.
Affected version
1.0.116 (saw it on 1.0.115 too), macOS arm64. The log says "Starting CLI in stdio mode (Rust JSON-RPC engine)".
Steps to reproduce the behavior
- Have a session with a very large events.jsonl (800 MB+).
- From the Python SDK over stdio:
session = await client.resume_session(session_id, ...) await session.get_events()await client.get_status()never returns.
Expected behavior
getMessages either returns or fails with an error, and the connection keeps working. Or, if the transport does break, the CLI exits or closes stdout so the client can tell.
Additional context
My guess is the whole response goes out in one write and hits the macOS limit where write(2) returns EINVAL above INT_MAX bytes. Chunking the write, or letting getMessages page, would probably fix it.
For now I work around it by not calling getMessages on big sessions (I read events.jsonl directly instead), plus timeouts and restarting the CLI when it stops answering.
- Ngôn ngữ chính
- Python
- Star
- 11.5k
- Fork
- 2k
- Merge trung bình
- 6 giờ 34 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/copilot-cli
-
area:plugins
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
github/copilot-cli#5567 ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
github/copilot-cli#5489 ·
-
Built-in functions.view returns no content for large files despite documenting automatic truncationĐang mởarea:tools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/copilot-cli#5476 ·
-
triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
github/copilot-cli#5377 ·
-
area:platform-windows area:tools
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
github/copilot-cli#5340 ·
Tất cả issue của github/copilot-cli
Issue tương tự
-
fidelity
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
backlog
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sagemathinc/sagebrush#3434 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
marketing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
wuisabel-gif/MemWhale#576 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Status: Triage Suggestion
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
GTNewHorizons/GT-New-Horizons-Modpack#27957 ·
Maintainer thường phản hồi trong vòng 1 ngày