multica-ai/multica · error

resolve comment: %w

Error message

resolve comment: %w

What it means

`multica issue comment resolve <comment-id>` POSTs to /api/comments/{id}/resolve. This error wraps a failed resolve call: comment not found, already resolved (depending on server semantics), lacking permission, or a transport error.

Source

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

func runIssueCommentUnresolve(cmd *cobra.Command, args []string) error {
	return runIssueCommentResolution(cmd, args[0], false)
}

func runIssueCommentResolution(cmd *cobra.Command, commentID string, resolve bool) error {
	client, err := newAPIClient(cmd)
	if err != nil {
		return err
	}

	ctx, cancel := cli.APIContext(context.Background())
	defer cancel()

	path := "/api/comments/" + url.PathEscape(commentID) + "/resolve"
	var result map[string]any
	if resolve {
		if err := client.PostJSON(ctx, path, nil, &result); err != nil {
			return fmt.Errorf("resolve comment: %w", err)
		}
		fmt.Fprintf(os.Stderr, "Comment %s resolved.\n", commentID)
	} else {
		if err := client.DeleteJSONResponse(ctx, path, &result); err != nil {
			return fmt.Errorf("unresolve comment: %w", err)
		}
		fmt.Fprintf(os.Stderr, "Comment %s unresolved.\n", commentID)
	}

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

// ---------------------------------------------------------------------------
// Execution history commands

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Verify the comment ID with `multica issue comment list`.
  2. Check auth/permissions on 401/403.
  3. Retry the resolve after transient failures.
Defensive patterns

Strategy: try-catch

Validate before calling

# bash: only resolve comments currently unresolved
state=$(multica issue comment list "$ISSUE" --output json | jq -r --arg c "$CID" '.[] | select(.id == $c) | .resolved')
[[ "$state" == "false" ]] || { echo "comment $CID not resolvable (state=$state)" >&2; exit 2; }

Try / catch

# bash: classify resolve failures
multica issue comment resolve "$CID" 2>/tmp/err || {
  grep -qE '404|not found' /tmp/err && { echo "already gone"; exit 0; }
  grep -qE '401|403' /tmp/err && { echo "permission problem" >&2; exit 2; }
  cat /tmp/err >&2; exit 1;
}

Prevention

When it happens

Trigger: Resolving a mistyped or deleted comment ID; resolving a comment in a workspace where you lack moderator rights; server/API unreachable.

Common situations: Thread-resolution automation hitting comments that were removed; stale IDs from an old listing; token expiry mid-batch.

Related errors


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