Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

OpenCode session with Claude Code stalls on occasion without clear reason

Đang mở
#139 0 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
api, backend, observability

Hướng nghiên cứu

Start by tracing Bash command execution and event emission in the sandbox-agent event stream, using the reported cargo test --test sessions run as a reproduction. Compare the stream while a long-running command executes with the events after it completes. Done means the API exposes enough command-start or progress information for the UI to distinguish active execution from a stalled session.

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

Mô tả

Summary

When using Claude Code through the OpenCode compatibility layer (e.g. via Gigacode), sessions can appear to stall without any clear error or indication of what went wrong. After investigation, the root cause is not an actual stall but a UX gap: no events are emitted during long-running Bash command execution, making the UI appear frozen.

Investigation Findings

What looked like a stall

Session ses_1 appeared frozen in Gigacode. The last visible API event was a permission.resolved for cargo test --test sessions (evt_1247). No new events appeared for ~2.5 minutes.

What was actually happening
  1. Claude Code requested permission to run cargo test --test sessions (5-minute timeout)
  2. The daemon auto-approved it (synthetic permission.resolved, 0.4ms after request)
  3. The test binary was actively running (PID 1277960, 14-18% CPU)
  4. Once tests completed (~2.5 min), events resumed normally (evt_1248+)

The session was never stalled. The Bash command was executing, but sandbox-agent emits no intermediate events during Bash execution — so the UI had no way to show progress.

Transcript vs API event divergence

Comparing the session-ses_1.md transcript (generated from Claude Code's stream-json) with the sandbox-agent events API revealed:

API Events Transcript
Tool calls 181 178
Subagent (inner) calls 117 (flattened inline) 0 (collapsed into Task result)
Ordering All calls including subagent inner calls, flat Top-level calls only

The ordering "mismatch" is because the API flattens subagent tool calls into the main event stream (each Read/Grep/Bash inside a Task appears as its own event with parent_tool_use_id), while the transcript collapses Task subagent activity into a single entry with a summary result.

This is not a bug — they're different views of the same activity. But it can be confusing when debugging.

Root Cause

No events emitted during Bash execution. When Claude Code runs a long command (e.g., cargo test with a 5-minute timeout), the sandbox-agent event stream goes silent until the command completes. There is no heartbeat, progress indicator, or "command still running" status event.

Suggested Improvements

  1. Emit periodic heartbeat/status events during long-running Bash commands (e.g., item.delta with a status content part like "Running: cargo test --test sessions (elapsed: 30s)")
  2. Surface Bash command start as a visible event so the UI can show "Executing command..." instead of appearing frozen
  3. Consider a timeout warning event when a command approaches its timeout limit

Environment

  • Agent: Claude Code (via OpenCode compat layer)
  • Interface: Gigacode
  • Permission mode: default
  • Model: claude-opus-4-6
Ngôn ngữ chính
TypeScript
Star
1.6k
Fork
134
Merge trung bình
12 giờ 54 phút
Pull request đã merge (30 ngày)
41

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 rivet-dev/agents

Tất cả issue của rivet-dev/agents

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.