{"record":{"id":"8fd6d6583d0397c4","repo":"vxcontrol/pentagi","slug":"unknown-detail-level-q-use-one-of-summary-task","errorCode":null,"errorMessage":"unknown detail level %q; use one of: summary, tasks, subtasks, running, planned","messagePattern":"unknown detail level %q; use one of: summary, tasks, subtasks, running, planned","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/pkg/tools/flow_manager.go","lineNumber":87,"sourceCode":"\tif err := json.Unmarshal(args, &action); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to parse get_flow_status args: %w\", err)\n\t}\n\n\tverbose := action.Verbose.Bool()\n\n\tswitch action.Detail {\n\tcase FlowStatusDetailSummary:\n\t\treturn t.buildSummary(ctx, verbose)\n\tcase FlowStatusDetailTasks:\n\t\treturn t.buildTasksList(ctx, verbose)\n\tcase FlowStatusDetailSubtasks:\n\t\treturn t.buildSubtasksList(ctx, action.TaskID.PtrInt64(), verbose)\n\tcase FlowStatusDetailRunning:\n\t\treturn t.buildRunningInfo(ctx, verbose)\n\tcase FlowStatusDetailPlanned:\n\t\treturn t.buildPlannedList(ctx, action.TaskID.PtrInt64(), verbose)\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unknown detail level %q; use one of: summary, tasks, subtasks, running, planned\", action.Detail)\n\t}\n}\n\nfunc (t *flowStatusTool) buildSummary(ctx context.Context, verbose bool) (string, error) {\n\ttasks, err := t.db.GetFlowTasks(ctx, t.flowID)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get flow tasks: %w\", err)\n\t}\n\n\tsubtasks, err := t.db.GetFlowSubtasks(ctx, t.flowID)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get flow subtasks: %w\", err)\n\t}\n\n\ttaskCounts := map[string]int{\"created\": 0, \"running\": 0, \"waiting\": 0, \"finished\": 0, \"failed\": 0}\n\tvar activeTask *database.Task\n\tfor i, task := range tasks {\n\t\ttaskCounts[string(task.Status)]++","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/flow_manager.go#L69-L105","documentation":"The get_flow_status tool dispatches on action.Detail against five known levels: summary, tasks, subtasks, running, planned. Any other value falls through to the default branch, which reports the invalid value and lists the accepted ones. Unlike the parse error, the JSON was valid — only the enum value was wrong.","triggerScenarios":"Calling get_flow_status with {\"detail\": \"full\"}, {\"detail\": \"overview\"}, {\"detail\": \"STATUS\"} (case-sensitive), or {\"detail\": \"\"}.","commonSituations":"LLM invents plausible-but-unsupported detail names ('all', 'overview', 'status'); shell wrappers uppercase enum values; a caller reuses detail values from a different tool with a similar-but-different enum; empty string when the field is set but never filled.","solutions":["Set detail to exactly one of: summary, tasks, subtasks, running, planned (lowercase).","Check the error message — it enumerates the valid values for you.","If a broader overview is needed, use 'summary' (the default) or 'tasks' rather than an invented level.","For LLM callers, add the allowed enum values to the tool description/schema to prevent guessing."],"exampleFix":"// before\n{\"detail\": \"overview\"}\n\n// after\n{\"detail\": \"summary\"}","handlingStrategy":"validation","validationCode":"var validDetails = map[string]bool{\n\t\"summary\": true, \"tasks\": true, \"subtasks\": true, \"running\": true, \"planned\": true,\n}\nfunc detailValid(d string) bool { return validDetails[strings.ToLower(d)] }","typeGuard":null,"tryCatchPattern":"detail := strings.ToLower(action.Detail)\nif !detailValid(detail) {\n\treturn fmt.Errorf(\"detail must be one of summary, tasks, subtasks, running, planned; got %q\", action.Detail)\n}","preventionTips":["Use the enum constants (FlowStatusDetailSummary etc.) instead of raw strings at call sites","List allowed values in the tool description so LLM callers cannot guess","Normalize casing before sending since matching is case-sensitive","Add a schema enum constraint on the detail field"],"tags":["enum","tool-args","validation","llm-tools"],"backgroundTag":"invalid-enum-value","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}