chenhg5/cc-connect · error
%s
Error message
%s
What it means
In agent/reasonix, when the serve stream emits a 'turn_done' event carrying a non-empty Err string, the session stores it as s.errTurn and emits a core.EventResult with Done=true and that error. The string is formatted into an error with fmt.Errorf("%s", we.Err). This is how the reasonix agent surfaces a failed turn to the engine and ultimately to the messaging platform.
Source
Thrown at agent/reasonix/session.go:429
qs = append(qs, core.UserQuestion{
Question: q.Prompt,
Header: q.Header,
Options: opts,
MultiSelect: q.Multi,
})
}
s.emit(core.Event{
Type: core.EventPermissionRequest,
RequestID: we.Ask.ID,
Questions: qs,
})
case "turn_done":
s.flushThinking()
s.inTurn.Store(false)
s.mu.Lock()
if we.Err != "" {
s.errTurn = fmt.Errorf("%s", we.Err)
}
errTurn := s.errTurn
s.mu.Unlock()
s.emit(core.Event{Type: core.EventResult, Done: true, Error: errTurn})
s.turnDone <- struct{}{}
case "notice":
s.flushThinking()
s.emit(core.Event{Type: core.EventText, Content: "[Notice] " + we.Text})
case "usage", "compaction_started", "compaction_done":
// Informational, no user-visible event needed
default:
slog.Debug("reasonix: unhandled event", "kind", we.Kind)
}
}View on GitHub (pinned to 4000b2338a)
Solutions
- Read the wrapped Err text in the emitted EventResult — it carries the reasonix-side failure message; fix the underlying agent issue it reports
- Check the reasonix serve process logs around the failing turn for a stack trace or exit reason
- Verify the reasonix serve endpoint is a compatible version and the model/config passed at session creation is valid
- Retry the turn; if it reproduces, reproduce with a minimal prompt to isolate agent-side vs request-side causes
Example fix
// engine side: surface the wrapped error to the user
if ev.Error != nil {
reply := fmt.Sprintf("turn failed: %v", ev.Error)
p.Reply(chatID, reply)
} Defensive patterns
Strategy: try-catch
Try / catch
// Go: inspect the emitted event
for ev := range sess.Events() {
if ev.Type == core.EventResult && ev.Error != nil {
slog.Error("reasonix turn failed", "err", ev.Error)
notifyUser(chatID, fmt.Sprintf("turn failed: %v", ev.Error))
}
} Prevention
- Keep the reasonix serve process healthy and version-matched to the adapter
- Surface EventResult.Error to users instead of silently ending the turn
- Log every turn-level error with the prompt for later triage
When it happens
Trigger: The reasonix serve endpoint's SSE stream sends {"type":"turn_done","error":"..."} with a non-empty error field — i.e. the underlying reasonix agent process/turn failed after streaming started.
Common situations: Reasonix CLI crashed mid-turn, invalid model name, context window exceeded, agent-internal tool failure, or the serve process returned a turn-level error after partial output was already streamed to the user.
Related errors
- acp: agent option "cmd" or "command" is required (path or na
- acp: command %q not found in PATH: %w
- %s
- session is closed
- job timed out after %v
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/242aa39adeba4dbf.
Report an issue: GitHub.