{"record":{"id":"7c7b08d4d7caf808","repo":"vxcontrol/pentagi","slug":"operation-d-add-requires-description","errorCode":null,"errorMessage":"operation %d: add requires description","messagePattern":"operation (.+?): add requires description","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/pkg/tools/args.go","lineNumber":326,"sourceCode":"}\n\n// PatchFlowSubtasksAction defines arguments for the patch_flow_subtasks tool.\ntype PatchFlowSubtasksAction struct {\n\tTaskID     int64              `json:\"task_id\" jsonschema:\"required,type=integer\" jsonschema_description:\"ID of the task whose subtask plan to modify. Obtain this from get_flow_status with detail='tasks'.\"`\n\tOperations []SubtaskOperation `json:\"operations\" jsonschema:\"required\" jsonschema_description:\"Delta operations to apply: add (insert new subtask at a position), remove (delete by ID), modify (update title/description), reorder (move to different position). Empty array returns the current plan unchanged. Each operation's title/description, when present, is an engagement-log plan entry (see operations).\"`\n\tMessage    string             `json:\"message\" jsonschema:\"required,title=Patch summary\" jsonschema_description:\"Engagement-log entry — a 1-2 short sentence running commentary describing what changes are being made to the plan. Written in the engagement language declared by your system prompt.\"`\n}\n\n// ValidateSubtaskPatch validates the operations in a SubtaskPatch\nfunc (sp SubtaskPatch) Validate() error {\n\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)","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/args.go#L308-L344","documentation":"Same SubtaskPatch.Validate path: for op == SubtaskOpAdd the Description field is required; this error fires when Title is present but Description is empty. Descriptions carry the plan detail the executor agent needs.","triggerScenarios":"A patch containing {\"op\":\"add\",\"title\":\"Port scan\"} with no description, submitted via patch_flow_subtasks or SubtaskPatch.Validate.","commonSituations":"LLM emitting terse add operations; script-generated patches that only set titles; UI/tooling that maps a one-line plan entry into an add op without description.","solutions":["Populate description for each add operation (what/how the subtask will accomplish).","Pre-validate operations and auto-reject or auto-expand adds lacking descriptions.","Adjust the agent prompt/schema so descriptions are always generated."],"exampleFix":"// before\nops := []SubtaskOperation{{Op: SubtaskOpAdd, Title: \"Port scan\"}}\n// after\nops := []SubtaskOperation{{Op: SubtaskOpAdd, Title: \"Port scan\", Description: \"Run nmap against target and record open ports\"}}","handlingStrategy":"validation","validationCode":"for i, op := range ops {\n    if op.Op == \"add\" && op.Description == \"\" {\n        return fmt.Errorf(\"op %d: add needs description\", i)\n    }\n}","typeGuard":"func hasDescription(op SubtaskOperation) bool {\n    return op.Op != SubtaskOpAdd || op.Description != \"\"\n}","tryCatchPattern":"if err := patch.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"add requires description\") {\n        // autofill a placeholder description or reject the patch before apply\n    }\n}","preventionTips":["Generate descriptions alongside titles in every plan-writing prompt.","Reject add operations lacking descriptions at patch construction time.","Keep the tool schema description explicit that description is mandatory for add.","Autofill from the title when only a title is available, then validate."],"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"}