{"record":{"id":"ab8a79bc822ce964","repo":"multica-ai/multica","slug":"list-comments-w","errorCode":null,"errorMessage":"list comments: %w","messagePattern":"list comments: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":1897,"sourceCode":"\t\tparams.Set(\"tail\", fmt.Sprintf(\"%d\", tail))\n\t}\n\tif recentSet {\n\t\tparams.Set(\"recent\", fmt.Sprintf(\"%d\", recent))\n\t}\n\tif before != \"\" {\n\t\tparams.Set(\"before\", before)\n\t\tparams.Set(\"before_id\", beforeID)\n\t}\n\n\tpath := \"/api/issues/\" + issueRef.ID + \"/comments\"\n\tif len(params) > 0 {\n\t\tpath += \"?\" + params.Encode()\n\t}\n\n\tvar comments []map[string]any\n\trespHeaders, err := client.GetJSONWithHeaders(ctx, path, &comments)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"list comments: %w\", err)\n\t}\n\t// The server emits the next-page cursor in headers when there is likely\n\t// an older page. Surface it on stderr so an operator (and the agent\n\t// prompt update that follows this PR) can scroll deeper without having\n\t// to dig into the raw HTTP response. Label depends on which paging mode\n\t// the caller is in — under --recent the cursor is a thread cursor;\n\t// under --thread + --tail it is a reply cursor inside that thread.\n\tif nb := respHeaders.Get(\"X-Multica-Next-Before\"); nb != \"\" {\n\t\tif nbid := respHeaders.Get(\"X-Multica-Next-Before-Id\"); nbid != \"\" {\n\t\t\tlabel := \"Next thread cursor\"\n\t\t\tif thread != \"\" && tailSet {\n\t\t\t\tlabel = \"Next reply cursor\"\n\t\t\t}\n\t\t\tfmt.Fprintf(os.Stderr, \"%s: --before %s --before-id %s\\n\", label, nb, nbid)\n\t\t}\n\t}\n\n\toutput, _ := cmd.Flags().GetString(\"output\")","sourceCodeStart":1879,"sourceCodeEnd":1915,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L1879-L1915","documentation":"This is the wrapped failure from the GET /api/issues/{id}/comments call made by `multica issue comment list`. The underlying error comes from the HTTP client (connection refused, 401/403 auth failure, 404 unknown issue, 5xx, timeout) and is chained with %w so the cause stays visible.","triggerScenarios":"The multica server is not running or unreachable; the API token is missing/expired; the issue reference resolves but the comments endpoint returns 4xx/5xx; the request exceeds the API timeout.","commonSituations":"Pointing the CLI at a stale server URL in config; expired session token; network/VPN issues; server restarted mid-session.","solutions":["Verify the server is up and the CLI targets the right base URL (multica config).","Re-authenticate / refresh the API token.","Confirm the issue ID exists and you have access to its workspace.","Retry once the server or network recovers; check server logs if 5xx persists."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# bash: pre-flight before listing comments\nmultica health >/dev/null 2>&1 || { echo \"server unreachable\" >&2; exit 2; }\nmultica issue get \"$ISSUE\" >/dev/null 2>&1 || { echo \"issue unresolved\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":"# bash: distinguish transient from permanent failures\nout=$(multica issue comment list \"$ISSUE\" 2>&1)\nif [[ $? -ne 0 ]]; then\n  if grep -qE 'connection refused|timeout|50[0-3]' <<<\"$out\"; then\n    sleep 2; out=$(multica issue comment list \"$ISSUE\" 2>&1) || { echo \"$out\" >&2; exit 1; }\n  else\n    echo \"$out\" >&2; exit 1\n  fi\nfi","preventionTips":["Run a health/get pre-flight before batch comment listings.","Keep the CLI config's base URL and token fresh; wrap batch jobs with one retry on transient errors."],"tags":["cli","http","api-client","comments"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}