{"record":{"id":"8c90f84fca15742e","repo":"Tencent/WeKnora","slug":"failed-to-roll-back-incoming-pages-s","errorCode":null,"errorMessage":"failed to roll back incoming pages: %s","messagePattern":"failed to roll back incoming pages: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/agent/tools/wiki_link_mutation.go","lineNumber":69,"sourceCode":"\t}\n\treturn changes, updatedSlugs, nil\n}\n\nfunc rollbackWikiContentChanges(\n\tctx context.Context,\n\tservice interfaces.WikiPageService,\n\tchanges []appliedWikiContentChange,\n) error {\n\tvar failures []string\n\tfor i := len(changes) - 1; i >= 0; i-- {\n\t\tchange := changes[i]\n\t\tchange.page.Content = change.originalContent\n\t\tif err := service.UpdateAutoLinkedContent(ctx, change.page); err != nil {\n\t\t\tfailures = append(failures, fmt.Sprintf(\"%s: %v\", change.page.Slug, err))\n\t\t}\n\t}\n\tif len(failures) > 0 {\n\t\treturn fmt.Errorf(\"failed to roll back incoming pages: %s\", strings.Join(failures, \"; \"))\n\t}\n\treturn nil\n}\n\nfunc joinWikiMutationErrors(primary error, extras ...error) string {\n\tparts := []string{primary.Error()}\n\tfor _, err := range extras {\n\t\tif err != nil {\n\t\t\tparts = append(parts, err.Error())\n\t\t}\n\t}\n\treturn strings.Join(parts, \"; \")\n}\n","sourceCodeStart":51,"sourceCodeEnd":83,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/agent/tools/wiki_link_mutation.go#L51-L83","documentation":"Compensation failure: while restoring original content on already-rewritten wiki pages (reverse order), one or more UpdateAutoLinkedContent calls failed; the collected per-slug failures are joined, meaning the rollback itself was incomplete and some pages may retain machine-rewritten links.","triggerScenarios":"Thrown at internal/agent/tools/wiki_link_mutation.go:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the joined per-slug failures for causes","Manually reconcile pages that failed to roll back","Add retry or manual-repair queue for failed compensations"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}