{"record":{"id":"6b2220f7dba10205","repo":"vxcontrol/pentagi","slug":"operation-d-modify-requires-at-least-title-or-de","errorCode":null,"errorMessage":"operation %d: modify requires at least title or description","messagePattern":"operation (.+?): modify requires at least title or description","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/pkg/tools/args.go","lineNumber":337,"sourceCode":"\tfor i, op := range sp.Operations {\n\t\tswitch op.Op {\n\t\tcase SubtaskOpAdd:\n\t\t\tif op.Title == \"\" {\n\t\t\t\treturn fmt.Errorf(\"operation %d: add requires title\", i)\n\t\t\t}\n\t\t\tif op.Description == \"\" {\n\t\t\t\treturn fmt.Errorf(\"operation %d: add requires description\", i)\n\t\t\t}\n\t\tcase SubtaskOpRemove:\n\t\t\tif op.ID == nil {\n\t\t\t\treturn fmt.Errorf(\"operation %d: remove requires id\", i)\n\t\t\t}\n\t\tcase SubtaskOpModify:\n\t\t\tif op.ID == nil {\n\t\t\t\treturn fmt.Errorf(\"operation %d: modify requires id\", i)\n\t\t\t}\n\t\t\tif op.Title == \"\" && op.Description == \"\" {\n\t\t\t\treturn fmt.Errorf(\"operation %d: modify requires at least title or description\", i)\n\t\t\t}\n\t\tcase SubtaskOpReorder:\n\t\t\tif op.ID == nil {\n\t\t\t\treturn fmt.Errorf(\"operation %d: reorder requires id\", i)\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"operation %d: unknown operation type %q\", i, op.Op)\n\t\t}\n\t}\n\treturn nil\n}\n\ntype Bool bool\n\nfunc (b *Bool) UnmarshalJSON(data []byte) error {\n\tsdata := strings.Trim(strings.ToLower(string(data)), \"' \\\"\\n\\r\\t\")\n\tswitch sdata {\n\tcase \"true\":","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/args.go#L319-L355","documentation":"For SubtaskOpModify, Validate requires at least one of Title or Description to be non-empty (a modify that changes nothing is rejected). This error fires when an ID is supplied but both fields are empty.","triggerScenarios":"Patch operation {\"op\":\"modify\",\"id\":7} with empty/omitted title and description, via patch_flow_subtasks or SubtaskPatch.Validate.","commonSituations":"LLM emits no-op modify entries; code that copies an operation struct and blanks both fields; attempting to 'touch' a subtask to trigger refresh.","solutions":["Provide the new title or description the modify should apply.","Drop no-op modify operations from the patch before validation.","Use remove+add instead if the intent was to replace a subtask entirely."],"exampleFix":"// before\nops := []SubtaskOperation{{Op: SubtaskOpModify, ID: int64Ptr(7)}}\n// after\nops := []SubtaskOperation{{Op: SubtaskOpModify, ID: int64Ptr(7), Description: \"Escalate privileges after initial access\"}}","handlingStrategy":"validation","validationCode":"for i, op := range ops {\n    if op.Op == \"modify\" && op.Title == \"\" && op.Description == \"\" {\n        return fmt.Errorf(\"op %d: modify needs title or description\", i)\n    }\n}","typeGuard":"func isMeaningfulModify(op SubtaskOperation) bool {\n    return op.Op != SubtaskOpModify || op.Title != \"\" || op.Description != \"\"\n}","tryCatchPattern":"if err := patch.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"modify requires at least title or description\") {\n        // drop the no-op operation or fill in the intended change\n    }\n}","preventionTips":["Strip no-op modify operations before applying a patch.","Require at least one changed field when building modify ops programmatically.","Make prompts forbid empty modify operations.","Diff current vs desired subtask content and only emit modify ops with real changes."],"tags":["validation","tool-args","subtasks"],"backgroundTag":"missing-required-argument","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}