agent/api/task/status/taskstatus.go
func (ts *TaskStatus) UnmarshalJSON(b []byte) error {
	if strings.ToLower(string(b)) == "null" {
		*ts = TaskStatusNone
		return nil
	}
	if b[0] != '"' || b[len(b)-1] != '"' {
		*ts = TaskStatusNone
		return errors.New("TaskStatus must be a string or null")
	}
	strStatus := string(b[1 : len(b)-1])
	// 'UNKNOWN' and 'DEAD' for Compatibility with v1.0.0 state files
	if strStatus == "UNKNOWN" {
		*ts = TaskStatusNone
		return nil
	}
	if strStatus == "DEAD" {
		*ts = TaskStopped
		return nil
	}

	stat, ok := taskStatusMap[strStatus]
	if !ok {
		*ts = TaskStatusNone
		return errors.New("Unrecognized TaskStatus")
	}
	*ts = stat
	return nil
}
func (ts *TaskStatus) UnmarshalJSON(b []byte) error {
	if strings.ToLower(string(b)) == "null" {
		*ts = TaskStatusNone
		return nil
	}
	if b[0] != '"' || b[len(b)-1] != '"' {
		*ts = TaskStatusNone
		return errors.New("TaskStatus must be a string or null")
	}
	strStatus := string(b[1 : len(b)-1])
	// 'UNKNOWN' and 'DEAD' for Compatibility with v1.0.0 state files
	if strStatus == "UNKNOWN" {
		*ts = TaskStatusNone
		return nil
	}
	if strStatus == "DEAD" {
		*ts = TaskStopped
		return nil
	}

	stat, ok := taskStatusMap[strStatus]
	if !ok {
		*ts = TaskStatusNone
		return errors.New("Unrecognized TaskStatus")
	}
	*ts = stat
	return nil
}
// UnmarshalJSON overrides the logic for parsing the JSON-encoded TaskStatus data