OpenCode session with Claude Code stalls on occasion without clear reason
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- api, backend, observability
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- Claude Code requested permission to run
cargo test --test sessions(5-minute timeout) - The daemon auto-approved it (synthetic
permission.resolved, 0.4ms after request) - The test binary was actively running (PID 1277960, 14-18% CPU)
- 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
- Emit periodic heartbeat/status events during long-running Bash commands (e.g.,
item.deltawith a status content part like "Running: cargo test --test sessions (elapsed: 30s)") - Surface Bash command start as a visible event so the UI can show "Executing command..." instead of appearing frozen
- 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
- 主要言語
- TypeScript
- スター
- 1.6k
- フォーク
- 131
- 平均マージ
- 7時間 40分
- マージ済み PR(30日)
- 29
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rivet-dev/agents のほかの issue
-
skills add rivet-dev/skills -s sandbox-agent fails: the skill was removed from rivet-dev/skillsオープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
rivet-dev/agents#319 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
rivet-dev/agents#313 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
bug: codex model variants are out of order対応中かも @c7ozkan が 206 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
rivet-dev/agents の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
vercel/streamdown#673 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
docs(stream-protocol): document messageMetatadata on start/finish and the message-metadata chunk対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンfactory-active task-identify-harness-labels-done task-identify-issue-type-done
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
agilepathway/label-checker#721 ·
メンテナーはふだん 1 日以内に返信
-
CLI Empathy needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
chromaui/chromatic-cli#1524 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信