xpzouying/xiaohongshu-mcp · warning
该评论已删除或不可见,不能回复: %s
Error message
该评论已删除或不可见,不能回复: %s
What it means
locate() scans the「评论和@」notification list for the target commentID. If the entry is found in the API payload but its visible() check fails, the comment has been deleted or is no longer visible to the account, so replying is impossible. This is thrown by locate, which is shared by Like and Reply.
Source
Thrown at xiaohongshu/notification_reply.go:117
}, nil
}
// locate 找到目标评论在当前分区里的位置,必要时滚动加载。
func (n *NotificationAction) locate(ctx context.Context, page *rod.Page, commentID string) (*rawNotification, int, error) {
const maxRounds = 20
for range maxRounds {
payload, err := n.readTab(page, TabMentions)
if err != nil {
return nil, 0, err
}
for i, r := range payload.MessageList {
if r.Comment.ID != commentID {
continue
}
if !r.visible() {
return nil, 0, fmt.Errorf("该评论已删除或不可见,不能回复: %s", commentID)
}
return &r, i, nil
}
if !payload.HasMore {
return nil, 0, fmt.Errorf("未找到评论 %s,它可能不在「评论和@」里或已被清理", commentID)
}
if err := page.Mouse.Scroll(0, 800, 5); err != nil {
return nil, 0, fmt.Errorf("滚动查找失败: %w", err)
}
humanize.Delay(ctx, humanize.BetweenScroll)
if err := ctx.Err(); err != nil {
return nil, 0, err
}
}
return nil, 0, fmt.Errorf("翻找 %d 轮仍未定位到评论 %s", maxRounds, commentID)View on GitHub (pinned to 332d196854)
Solutions
- Verify the comment still exists in the Xiaohongshu web UI
- Remove the stale commentID from your task queue and continue processing others
- Treat this as non-fatal in batch flows: log and skip
- Re-fetch fresh notifications instead of relying on cached comment IDs
Defensive patterns
Strategy: try-catch
Try / catch
_, err := n.Reply(ctx, commentID, content)
if err != nil && strings.Contains(err.Error(), "已删除或不可见") {
log.Infof("comment %s gone, skipping", commentID)
return nil // expected state, do not retry
} Prevention
- Treat deleted/hidden comments as a normal outcome in batch flows
- Process notifications promptly before content is removed
- Never retry on this error — state will not change
When it happens
Trigger: Reply or Like called with a commentID that exists in payload.MessageList but whose record fails r.visible() — deleted comment, hidden/blocked thread, or restricted content.
Common situations: Queue holds stale comment IDs deleted by authors or moderators; comment under a note that was set private; account blocked by the comment author; replying too long after the notification arrived.
Related errors
- 该通知没有回复入口(评论可能已删除或不可回复): %w
- ErrNoFeeds
- ErrNoFeedDetail
- current user not found in page state
- qrcode src is empty
AI-assisted analysis of xpzouying/xiaohongshu-mcp@332d196854 (2026-09-05).
Data as JSON: /api/errors/a82216c409857a7c.
Report an issue: GitHub.