multica-ai/multica · error

list run messages: %w

Error message

list run messages: %w

What it means

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.

Source

Thrown at server/cmd/multica/cmd_issue.go:2208

		issueRef, err := resolveIssueRef(ctx, client, issueInput)
		if err != nil {
			return fmt.Errorf("resolve issue: %w", err)
		}
		issueID = issueRef.ID
	}
	taskRef, err := resolveTaskRunID(ctx, client, issueID, args[0])
	if err != nil {
		return fmt.Errorf("resolve task run: %w", err)
	}

	path := "/api/tasks/" + url.PathEscape(taskRef.ID) + "/messages"
	if since, _ := cmd.Flags().GetInt("since"); since > 0 {
		path += fmt.Sprintf("?since=%d", since)
	}

	var messages []map[string]any
	if err := client.GetJSON(ctx, path, &messages); err != nil {
		return fmt.Errorf("list run messages: %w", err)
	}

	output, _ := cmd.Flags().GetString("output")
	if output == "json" {
		return cli.PrintJSON(os.Stdout, messages)
	}

	headers := []string{"SEQ", "TYPE", "TOOL", "CONTENT"}
	rows := make([][]string, 0, len(messages))
	for _, m := range messages {
		content := strVal(m, "content")
		if content == "" {
			content = strVal(m, "output")
		}
		if utf8.RuneCountInString(content) > 80 {
			runes := []rune(content)
			content = string(runes[:77]) + "..."
		}

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Verify the run exists via `multica issue runs <issue>`.
  2. Retry transient failures; check server logs for persistent 5xx.
  3. Ensure --since is a positive integer if used.
  4. Confirm token scope covers task message reads.
Defensive patterns

Strategy: try-catch

Validate before calling

# bash: confirm the run exists and --since is sane
[[ "${SINCE:-0}" =~ ^[0-9]+$ ]] || { echo "--since must be a positive integer" >&2; exit 2; }
multica issue runs "$ISSUE" --output json | jq -e --arg r "$RUN" 'any(.[]; .id == $r or (.id | endswith($r)))' >/dev/null \
  || { echo "run not found: $RUN" >&2; exit 2; }

Try / catch

# bash: separate purged runs from transient errors
multica issue run messages "$RUN" 2>/tmp/err || {
  grep -qE '404|not found' /tmp/err && { echo "run purged or unreadable" >&2; exit 2; }
  grep -qE 'timeout|connection|50[0-3]' /tmp/err && exec multica issue run messages "$RUN"
  cat /tmp/err >&2; exit 1;
}

Prevention

When it happens

Trigger: 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.

Common situations: Inspecting old runs whose message history was garbage-collected; scope-limited tokens; CI network flakiness.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/d9f4b4d9927acd8d. Report an issue: GitHub.