chenhg5/cc-connect · error
e.i18n.T(MsgListError)
Error message
e.i18n.T(MsgListError)
What it means
Rendered when the /list command fails to enumerate the agent's sessions: ListSessions(e.ctx) on the agent returned an error, and the engine formats it with the localized MsgListError template. It signals the agent CLI/backend could not be queried for its session list.
Source
Thrown at core/engine.go:13248
opts = append(opts, CardSelectOption{Text: label, Value: val})
if m.Key == current {
initVal = val
}
}
cb := NewCard().Title(e.i18n.T(MsgCardTitleMode), "violet").
Markdown(sb.String()).
Select(e.i18n.T(MsgModeSelectPlaceholder), opts, initVal).
Buttons(e.cardBackButton())
cb.Note(e.modeUsageText(modes))
return cb.Build()
}
func (e *Engine) renderListCard(sessionKey string, page int) (*Card, error) {
agent, sessions := e.sessionContextForKey(sessionKey)
agentSessions, err := agent.ListSessions(e.ctx)
if err != nil {
return nil, fmt.Errorf(e.i18n.T(MsgListError), err)
}
agentSessions = e.applySessionFilter(agentSessions, sessions)
if len(agentSessions) == 0 {
return e.simpleCard(e.i18n.Tf(MsgCardTitleSessions, agent.Name(), 0), "turquoise", e.i18n.T(MsgListEmpty)), nil
}
total := len(agentSessions)
totalPages := (total + listPageSize - 1) / listPageSize
if page > totalPages {
page = totalPages
}
start := (page - 1) * listPageSize
end := start + listPageSize
if end > total {
end = total
}
View on GitHub (pinned to 4000b2338a)
Solutions
- Read the wrapped err in the message for the agent-specific cause (command not found, non-zero exit, parse failure).
- Verify the agent CLI is installed and works standalone (e.g. `claude` / `codex` list-commands).
- Upgrade or align the agent CLI version with the one this adapter supports.
Example fix
// before
agentSessions, err := agent.ListSessions(e.ctx)
if err != nil { return nil, fmt.Errorf(e.i18n.T(MsgListError), err) }
// after
agentSessions, err := agent.ListSessions(e.ctx)
if err != nil {
slog.Error("list sessions failed", "agent", agent.Name(), "err", err)
return nil, fmt.Errorf(e.i18n.T(MsgListError), err)
} Defensive patterns
Strategy: try-catch
Validate before calling
if _, err := exec.LookPath(agentCLI); err != nil { return fmt.Errorf("agent CLI %q not found", agentCLI) } Type guard
if lister, ok := agent.(interface{ ListSessions(ctx context.Context) ([]SessionInfo, error) }); !ok { return nil, errors.New("agent does not support session listing") } Try / catch
sessions, err := agent.ListSessions(ctx)
if err != nil {
slog.Error("list failed", "agent", agent.Name(), "err", err)
return fmt.Errorf(e.i18n.T(MsgListError), err)
} Prevention
- Keep the agent CLI installed and on PATH; run `cc-connect doctor` to verify.
- Pin agent CLI versions compatible with this adapter.
- Check agent auth/session storage before issuing list commands.
When it happens
Trigger: Calling the sessions list command (renderListCard) while the underlying agent's ListSessions call fails — e.g. the agent CLI is missing, the CLI exits non-zero, or its output cannot be parsed.
Common situations: Agent binary not installed or not on PATH; agent version changed its `--list-sessions` output format; agent process fails due to auth or corrupted session storage.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
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
- opencode: session list: %w
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/2b0797c102a547f9.
Report an issue: GitHub.