{"record":{"id":"439275b81023b6f4","repo":"vxcontrol/pentagi","slug":"time-end-must-be-after-time-start","errorCode":null,"errorMessage":"time_end must be after time_start","messagePattern":"time_end must be after time_start","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/pkg/tools/graphiti_search.go","lineNumber":357,"sourceCode":"\tobservationObject *graphiti.Observation,\n) (string, error) {\n\t// Validate temporal parameters\n\tif args.TimeStart == \"\" || args.TimeEnd == \"\" {\n\t\treturn \"\", fmt.Errorf(\"time_start and time_end are required for temporal_window search\")\n\t}\n\n\ttimeStart, err := parseGraphitiTime(args.TimeStart)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"invalid time_start format (use ISO 8601, e.g. 2026-01-02T15:04:05Z): %w\", err)\n\t}\n\n\ttimeEnd, err := parseGraphitiTime(args.TimeEnd)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"invalid time_end format (use ISO 8601, e.g. 2026-01-02T15:04:05Z): %w\", err)\n\t}\n\n\tif timeEnd.Before(timeStart) {\n\t\treturn \"\", fmt.Errorf(\"time_end must be after time_start\")\n\t}\n\n\tmaxResults := args.MaxResults.Int()\n\tif maxResults <= 0 {\n\t\tmaxResults = DefaultTemporalMaxResults\n\t}\n\n\treq := graphiti.TemporalSearchRequest{\n\t\tQuery:       args.Query,\n\t\tGroupID:     &groupID,\n\t\tTimeStart:   timeStart,\n\t\tTimeEnd:     timeEnd,\n\t\tMaxResults:  maxResults,\n\t\tObservation: observationObject,\n\t}\n\n\tresp, err := t.graphitiClient.TemporalWindowSearch(ctx, req)\n\tif err != nil {","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/graphiti_search.go#L339-L375","documentation":"After parsing, the temporal_window search validates that the window is ordered: time_end must come after time_start. This error fires when the parsed end timestamp is before the parsed start timestamp, which would produce an empty or nonsensical query window for Graphiti.","triggerScenarios":"Passing time_start later than time_end, e.g. swapped values (start=2026-08-31, end=2026-08-01) or a negative window spanning a timezone mistake.","commonSituations":"Agents mixing up argument order; computing 'last 24h' with the offsets assigned to the wrong fields; timezone conversions flipping the ordering.","solutions":["Swap the values so time_start < time_end","Compute the window as start=now-minus-duration, end=now","Re-check timezone offsets on both timestamps to ensure the intended order"],"exampleFix":"// before\n{\"time_start\": \"2026-08-31T00:00:00Z\", \"time_end\": \"2026-08-01T00:00:00Z\"}\n// after\n{\"time_start\": \"2026-08-01T00:00:00Z\", \"time_end\": \"2026-08-31T00:00:00Z\"}","handlingStrategy":"validation","validationCode":"if !end.After(start) {\n    return errors.New(\"time_end must be after time_start\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compute windows as start = now - duration, end = now","Double-check argument order when constructing the payload","Normalize both timestamps to UTC before comparing"],"tags":["validation","temporal","argument-order","graphiti"],"backgroundTag":"invalid-date-range","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}