{"record":{"id":"f1bbe2e1813fe4ce","repo":"vxcontrol/pentagi","slug":"operation-d-modify-operation-missing-both-title","errorCode":null,"errorMessage":"operation %d: modify operation missing both title and description fields","messagePattern":"operation (.+?): modify operation missing both title and description fields","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"backend/pkg/providers/subtask_patch.go","lineNumber":78,"sourceCode":"\t\t\t\topLogger.Error(err.Error())\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif _, ok := idToIdx[*op.ID]; !ok {\n\t\t\t\terr := fmt.Errorf(\"operation %d: subtask with id %d not found for removal\", i, *op.ID)\n\t\t\t\topLogger.Error(err.Error())\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tremoved[*op.ID] = true\n\t\t\topLogger.WithField(\"subtask_id\", *op.ID).Debug(\"marked subtask for removal\")\n\n\t\tcase tools.SubtaskOpModify:\n\t\t\tif op.ID == nil {\n\t\t\t\terr := fmt.Errorf(\"operation %d: modify operation missing required id field\", i)\n\t\t\t\topLogger.Error(err.Error())\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif op.Title == \"\" && op.Description == \"\" {\n\t\t\t\terr := fmt.Errorf(\"operation %d: modify operation missing both title and description fields\", i)\n\t\t\t\topLogger.Error(err.Error())\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tidx, ok := idToIdx[*op.ID]\n\t\t\tif !ok {\n\t\t\t\terr := fmt.Errorf(\"operation %d: subtask with id %d not found for modification\", i, *op.ID)\n\t\t\t\topLogger.Error(err.Error())\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// Only update fields that are provided\n\t\t\tif op.Title != \"\" {\n\t\t\t\tresult[idx].Title = op.Title\n\t\t\t\topLogger.WithField(\"new_title\", op.Title).Debug(\"updated subtask title\")\n\t\t\t}\n\t\t\tif op.Description != \"\" {\n\t\t\t\tresult[idx].Description = op.Description\n\t\t\t\topLogger.WithField(\"new_description_len\", len(op.Description)).Debug(\"updated subtask description\")\n\t\t\t}","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/providers/subtask_patch.go#L60-L96","documentation":"A modify operation with an ID that is empty on both editable fields (title and description) is rejected: it would be a no-op or an accidental wipe. applySubtaskOperations requires at least one non-empty field to know what to change.","triggerScenarios":"LLM emits {\"op\":\"modify\",\"id\":2} (or with \"title\":\"\",\"description\":\"\") — the patch carries no actual change, so validation fails.","commonSituations":"Model echoing back a subtask unchanged; prompt asking for 'review and update' causing empty updates; template/serialization dropping optional empty strings leaving a bare modify.","solutions":["Retry the refiner call and instruct the model to only emit modify ops that change something.","Filter out empty modify operations client-side before applying the patch.","Add prompt guidance: omit modify operations that make no changes.","Treat this as a no-op and skip the operation if you control the caller."],"exampleFix":"// before\n{\"op\":\"modify\",\"id\":2,\"title\":\"\",\"description\":\"\"} // no change\n// after: either drop the op or provide real content\n{\"op\":\"modify\",\"id\":2,\"description\":\"Enumerate subdomains with amass\"}","handlingStrategy":"validation","validationCode":"for i, op := range ops {\n    if op.Op == tools.SubtaskOpModify && op.Title == \"\" && op.Description == \"\" {\n        return fmt.Errorf(\"op %d: modify is a no-op\", i)\n    }\n}","typeGuard":"func modifiesSomething(op tools.SubtaskOperation) bool {\n    return op.Title != \"\" || op.Description != \"\"\n}","tryCatchPattern":"patched, err := applySubtaskOperations(ctx, logger, ops, subtasks)\nif err != nil && strings.Contains(err.Error(), \"missing both title and description\") {\n    // drop no-op modify ops and reapply the rest\n    ops = filterNoopModifies(ops)\n    patched, err = applySubtaskOperations(ctx, logger, ops, subtasks)\n}","preventionTips":["Instruct the model to emit modify ops only with actual changes.","Pre-filter empty modify operations before applying patches.","Prompt the model to remove unchanged subtasks from its output entirely."],"tags":["validation","llm","subtasks","empty-payload"],"backgroundTag":"schema-validation-failed","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}