{"record":{"id":"d9f4b4d9927acd8d","repo":"multica-ai/multica","slug":"list-run-messages-w","errorCode":null,"errorMessage":"list run messages: %w","messagePattern":"list run messages: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":2208,"sourceCode":"\t\tissueRef, err := resolveIssueRef(ctx, client, issueInput)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"resolve issue: %w\", err)\n\t\t}\n\t\tissueID = issueRef.ID\n\t}\n\ttaskRef, err := resolveTaskRunID(ctx, client, issueID, args[0])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolve task run: %w\", err)\n\t}\n\n\tpath := \"/api/tasks/\" + url.PathEscape(taskRef.ID) + \"/messages\"\n\tif since, _ := cmd.Flags().GetInt(\"since\"); since > 0 {\n\t\tpath += fmt.Sprintf(\"?since=%d\", since)\n\t}\n\n\tvar messages []map[string]any\n\tif err := client.GetJSON(ctx, path, &messages); err != nil {\n\t\treturn fmt.Errorf(\"list run messages: %w\", err)\n\t}\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, messages)\n\t}\n\n\theaders := []string{\"SEQ\", \"TYPE\", \"TOOL\", \"CONTENT\"}\n\trows := make([][]string, 0, len(messages))\n\tfor _, m := range messages {\n\t\tcontent := strVal(m, \"content\")\n\t\tif content == \"\" {\n\t\t\tcontent = strVal(m, \"output\")\n\t\t}\n\t\tif utf8.RuneCountInString(content) > 80 {\n\t\t\trunes := []rune(content)\n\t\t\tcontent = string(runes[:77]) + \"...\"\n\t\t}","sourceCodeStart":2190,"sourceCodeEnd":2226,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L2190-L2226","documentation":"After resolving the task run, the CLI GETs /api/tasks/{id}/messages (with optional ?since=N). This error wraps that fetch failing: permission denial, run deleted, 5xx, or transport failure, with the cause chained.","triggerScenarios":"Fetching messages for a run you cannot read; the run was purged between resolution and fetch; server error; network drop; invalid --since value causing a 400.","commonSituations":"Inspecting old runs whose message history was garbage-collected; scope-limited tokens; CI network flakiness.","solutions":["Verify the run exists via `multica issue runs <issue>`.","Retry transient failures; check server logs for persistent 5xx.","Ensure --since is a positive integer if used.","Confirm token scope covers task message reads."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# bash: confirm the run exists and --since is sane\n[[ \"${SINCE:-0}\" =~ ^[0-9]+$ ]] || { echo \"--since must be a positive integer\" >&2; exit 2; }\nmultica issue runs \"$ISSUE\" --output json | jq -e --arg r \"$RUN\" 'any(.[]; .id == $r or (.id | endswith($r)))' >/dev/null \\\n  || { echo \"run not found: $RUN\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":"# bash: separate purged runs from transient errors\nmultica issue run messages \"$RUN\" 2>/tmp/err || {\n  grep -qE '404|not found' /tmp/err && { echo \"run purged or unreadable\" >&2; exit 2; }\n  grep -qE 'timeout|connection|50[0-3]' /tmp/err && exec multica issue run messages \"$RUN\"\n  cat /tmp/err >&2; exit 1;\n}","preventionTips":["Export/log run messages soon after runs finish, before retention purges them.","Validate --since as a positive integer in wrappers."],"tags":["cli","http","api-client","task-runs","messages"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}