{"record":{"id":"c79aace76733dad8","repo":"xpzouying/xiaohongshu-mcp","slug":"w-c79aac","errorCode":null,"errorMessage":"无法输入回复内容: %w","messagePattern":"无法输入回复内容: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xiaohongshu/notification_reply.go","lineNumber":73,"sourceCode":"\t}\n\n\thumanize.Delay(ctx, humanize.BeforeClick)\n\tif err := humanize.Click(replyBtn); err != nil {\n\t\treturn nil, fmt.Errorf(\"无法点击回复: %w\", err)\n\t}\n\thumanize.Delay(ctx, humanize.AfterClick)\n\n\tinput, err := item.Element(`textarea.comment-input`)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"回复输入框未出现: %w\", err)\n\t}\n\n\tif err := verifyReplyTarget(input, target.from().Nickname); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := humanize.Type(ctx, input, content); err != nil {\n\t\treturn nil, fmt.Errorf(\"无法输入回复内容: %w\", err)\n\t}\n\thumanize.Delay(ctx, humanize.AfterType)\n\n\tsubmit, err := item.Element(`button.submit`)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"未找到发送按钮: %w\", err)\n\t}\n\n\thumanize.Delay(ctx, humanize.BeforeSubmit)\n\tif err := humanize.Click(submit); err != nil {\n\t\treturn nil, fmt.Errorf(\"无法点击发送: %w\", err)\n\t}\n\n\tif err := waitReplyAccepted(item, 8*time.Second); err != nil {\n\t\treturn nil, err\n\t}\n\n\thumanize.Delay(ctx, humanize.AfterInteract)","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/xpzouying/xiaohongshu-mcp/blob/332d196854a9eac0d2b8c2c0e3d0cc43139d724c/xiaohongshu/notification_reply.go#L55-L91","documentation":"humanize.Type failed while typing the reply into the comment input, e.g. because the element lost focus, was detached, or the simulated keystrokes errored. Content was non-empty (validated earlier), so this is a UI-interaction failure, not a validation failure.","triggerScenarios":"humanize.Type(ctx, input, content) returns an error during Reply — textarea detached after re-render, focus stolen by popup, or ctx cancelled mid-typing.","commonSituations":"Page re-render replaced the textarea mid-type; browser tab lost focus in headful mode; context deadline exceeded during slow humanized typing of long content; anti-bot input interception.","solutions":["Retry the call; transient focus issues usually clear on retry","Shorten the reply content — long humanized typing increases the race window","Check ctx deadlines — ensure the context is not cancelled mid-typing","Keep the browser window focused (headful mode) or use headless mode consistently"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if ctx.Err() != nil {\n    return fmt.Errorf(\"context expired before reply: %w\", ctx.Err())\n}","typeGuard":null,"tryCatchPattern":"_, err := n.Reply(ctx, commentID, content)\nif err != nil && strings.Contains(err.Error(), \"无法输入回复内容\") {\n    time.Sleep(2 * time.Second)\n    _, err = n.Reply(ctx, commentID, content)\n}","preventionTips":["Use a context with enough budget for humanized typing","Keep reply texts reasonably short","Avoid focus competition in headful browsers"],"tags":["input","typing","go-rod","xiaohongshu"],"backgroundTag":"element-type-failed","analyzedSha":"332d196854a9eac0d2b8c2c0e3d0cc43139d724c","analyzedAt":"2026-09-05T22:22:55.988Z","contentChangedAt":"2026-09-05T22:22:55.988Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}