{"record":{"id":"2b0797c102a547f9","repo":"chenhg5/cc-connect","slug":"e-i18n-t-msglisterror","errorCode":null,"errorMessage":"e.i18n.T(MsgListError)","messagePattern":"e\\.i18n\\.T\\(MsgListError\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/engine.go","lineNumber":13248,"sourceCode":"\t\topts = append(opts, CardSelectOption{Text: label, Value: val})\n\t\tif m.Key == current {\n\t\t\tinitVal = val\n\t\t}\n\t}\n\n\tcb := NewCard().Title(e.i18n.T(MsgCardTitleMode), \"violet\").\n\t\tMarkdown(sb.String()).\n\t\tSelect(e.i18n.T(MsgModeSelectPlaceholder), opts, initVal).\n\t\tButtons(e.cardBackButton())\n\tcb.Note(e.modeUsageText(modes))\n\treturn cb.Build()\n}\n\nfunc (e *Engine) renderListCard(sessionKey string, page int) (*Card, error) {\n\tagent, sessions := e.sessionContextForKey(sessionKey)\n\tagentSessions, err := agent.ListSessions(e.ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(e.i18n.T(MsgListError), err)\n\t}\n\tagentSessions = e.applySessionFilter(agentSessions, sessions)\n\tif len(agentSessions) == 0 {\n\t\treturn e.simpleCard(e.i18n.Tf(MsgCardTitleSessions, agent.Name(), 0), \"turquoise\", e.i18n.T(MsgListEmpty)), nil\n\t}\n\n\ttotal := len(agentSessions)\n\ttotalPages := (total + listPageSize - 1) / listPageSize\n\tif page > totalPages {\n\t\tpage = totalPages\n\t}\n\n\tstart := (page - 1) * listPageSize\n\tend := start + listPageSize\n\tif end > total {\n\t\tend = total\n\t}\n","sourceCodeStart":13230,"sourceCodeEnd":13266,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/engine.go#L13230-L13266","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nagentSessions, err := agent.ListSessions(e.ctx)\nif err != nil { return nil, fmt.Errorf(e.i18n.T(MsgListError), err) }\n// after\nagentSessions, err := agent.ListSessions(e.ctx)\nif err != nil {\n    slog.Error(\"list sessions failed\", \"agent\", agent.Name(), \"err\", err)\n    return nil, fmt.Errorf(e.i18n.T(MsgListError), err)\n}","handlingStrategy":"try-catch","validationCode":"if _, err := exec.LookPath(agentCLI); err != nil { return fmt.Errorf(\"agent CLI %q not found\", agentCLI) }","typeGuard":"if lister, ok := agent.(interface{ ListSessions(ctx context.Context) ([]SessionInfo, error) }); !ok { return nil, errors.New(\"agent does not support session listing\") }","tryCatchPattern":"sessions, err := agent.ListSessions(ctx)\nif err != nil {\n    slog.Error(\"list failed\", \"agent\", agent.Name(), \"err\", err)\n    return fmt.Errorf(e.i18n.T(MsgListError), err)\n}","preventionTips":["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."],"tags":["sessions","agent","list-commands"],"backgroundTag":"database-query-failed","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}