Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

OpenCode session with Claude Code stalls on occasion without clear reason

Aperta
#139 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
1.6k
Fork
131
Merge medio
7h 40m
PR unite (30g)
29

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rivet-dev/agents

Tutte le issue di rivet-dev/agents

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.