[Bug]: Cursor shell commands never stream live output

Đang mở Phù hợp với người mới
#30,228 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu trong packages/provider-cursor/src/server/adapter.ts: shellOutputText (~L1975) không xử lý dạng oneof protobuf của Cursor ({ case: 'stdout', value: { data } }), vì vậy shell-output-delta (~L2048) trả về sớm và không có command_output.delta nào được phát ra. Tái hiện bằng vòng lặp shell năm dòng trong báo cáo và theo dõi xem có delta nào trước khi hoàn tất hay không. Hoàn thành khi stdout/stderr được truyền phát tăng dần như với Codex/Claude, được kiểm tra bằng một bài kiểm thử streaming của provider.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Before submitting
  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.
Area

apps/server

Steps to reproduce
  1. Use the Cursor provider (@cursor/sdk 1.2.0) and start a turn.
  2. Ask the agent to run a command that prints over several seconds, e.g. for i in 1 2 3 4 5; do echo "tick $i"; sleep 2; done.
  3. Expand the command row while the command is still running.
Expected behavior

Output appears incrementally while the command runs, the same way it does for Codex and Claude Agent. The expanded row should show tick 1, tick 2, … as they are printed.

Actual behavior

The expanded command row stays empty for the whole run. The complete output appears at once when the tool call finishes, so a long command looks hung.

This affects every Cursor shell command, including a real ~3 minute remote deploy where the whole log landed only at completion.

Impact

Major degradation or frequent failure

Version or commit

main @ cefb544af3 (also reproduced on 0.1.7-nightly.20261103.4119)

Environment

Linux, web client, Cursor provider via @cursor/sdk 1.2.0, default Cursor model, local mode.

Logs or stack traces

Redacted reproduction log. The command emits 5 lines over ~10s; T3 shows nothing until the end.

[12:00:00] INFO  running command
[12:00:10] INFO  command finished (5 lines of stdout)

# T3 UI while running: command row expanded, no output
# T3 UI after completion: all 5 lines appear at once

Root cause is in the adapter, not the transport. Cursor sends the delta as a protobuf oneof:

{ "case": "stdout", "value": { "data": "tick 1\n" } }
{ "case": "stderr", "value": { "data": "" } }
{ "case": "exit",   "value": { "code": 0, "aborted": false } }

packages/provider-cursor/src/server/adapter.ts (shellOutputText, ~L1975) only looks at
event.text, event.output, event.data, event.stdout, event.stderr, event.chunk, so it
returns "". shell-output-delta (~L2048) then returns early at:

const chunk = shellOutputText(update.event);
if (chunk.length === 0) return;

So command_output.delta is never emitted for Cursor, while the final output still arrives through
the completion fallback in emitToolArtifacts (cursorToolOutputText(toolCall) || streamedOutput).

The SDK does stream live: @cursor/sdk dist/esm/336.js runs handleShellStream concurrently with
the tool call and sends one shellOutputDelta update per stdout/stderr chunk.

Workaround

Run the command outside T3 (terminal/ssh) and paste the result, or keep the row collapsed and wait
for the completion output.

Ngôn ngữ chính
TypeScript
Star
24.8k
Fork
6.4k
Merge trung bình
7 giờ 39 phút
Pull request đã merge (30 ngày)
123

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pingdotgg/t3code

Tất cả issue của pingdotgg/t3code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.